On 19 July 2010 23:35, Seth Willits
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:> From the documentation:
>
>
> ------------------------------
> class Shirt < ActiveRecord::Base
> named_scope :red, :conditions => {:color =>
''red''}
> end
>
> Unlike Shirt.find(...), however, the object returned by Shirt.red is not
> an Array; it resembles the association object constructed by a has_many
> declaration. For instance, you can invoke Shirt.red.find(:first),
> Shirt.red.count, Shirt.red.find(:all, :conditions => {:size =>
‘small’})
> ------------------------------
>
>
> So Shirt.red.find(:all, ....) is valid according to the docs.
>
> I have:
>
>
> ------------------------------
> class Member < ActiveRecord::Base
> named_scope :active_members, :conditions => { :rcrd_status =>
''Y'' }
> end
> ------------------------------
>
>
> And wish to call:
> Member.active_members.find(:all, :conditions => { ... })
>
>
> But I''m getting the error:
> # ArgumentError (wrong number of arguments (2 for 1)): in `find''
Can you show us the exact line that fails please with a few lines each
side, with line numbers, and the trace dump?
What happens if you use active_members without the find?
Colin
>
>
> And I noticed Member.active_members.class.to_s returns "Array"
>
>
> What gives? I can''t imagine the documentation being *that* wrong,
so
> what did I do wrong?
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.