sscirrus
sscirrus

Reputation: 56719

Rails 3 ActiveRecord Questions

I have a few queries for you Rails 3 gurus out there. How can you accomplish the following?

The following pseudocode is currently invalid. Thanks all.

@items = (@itemsA + @itemsB).order("name ASC")

@item = Item.where("type = ?" and "condition = ?", "book", "new")

@commenteditems = Item.find_all_by_type_and_condition("book", "new").include("notes").select("item[name]", "notes[note]")

@selecteditems = @items.where("select = ?", true)

Upvotes: 0

Views: 89

Answers (1)

MunkiPhD
MunkiPhD

Reputation: 3644

I believe what you're looking for is scopes.

Upvotes: 1

Related Questions