Flowdock
method

included

Importance_1
v2.2.1 - Show latest stable - 0 notes - Class: ActiveRecord::NamedScope
included(base) public

All subclasses of ActiveRecord::Base have two named \scopes:

  • all - which is similar to a find(:all) query, and
  • scoped - which allows for the creation of anonymous \scopes, on the fly: Shirt.scoped(:conditions => {:color => 'red'}).scoped(:include => :washing_instructions)

These anonymous \scopes tend to be useful when procedurally generating complex queries, where passing intermediate values (scopes) around as first-class objects is convenient.

Show source
Register or log in to add new notes.