Loves me some puzzles. OK, I think I have the answer. ActiveRecord::Base has a line in it:
delegate :select, :group, :order, :reorder, :except, :limit, :offset, :joins, :where, :preload, :eager_load, :includes, :from, :lock, :readonly, :having, :create_with, :to => :scoped The method scoped() is defined in ActiveRecord::NamedScope::ClassMethods, and ActiveRecord::NamedScope is included in ActiveRecord::Base. Far from obvious, but there it is. On Tue, Mar 8, 2011 at 7:00 AM, tinkerer13 <[email protected]> wrote: > On Mar 7, 10:12 pm, Bryan Crossland <[email protected]> wrote: > > Exit the console and edit the class to inherit ActiveRecord::Base. > > > > class Foo < ActiveRecord::Base > > > > end > > > > Start the console again and re-run the command. In the bottom of that > list > > you will find the method "where", inherited from ActiveRecord::Base. > > > > B. > > Ok, now we're getting somewhere... > > Looking at the source code for ActiveRecord::Base, I do NOT see > "where" defined on ActiveRecord::Base. Nor is it defined in any > superclass (Object). Nor do I see it defined in the docs (under > methods). > > So where the heck is it coming from? And if it's not defined in the > docs, how would I know about it? > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

