Let''s say I''ve got a table of people. Each person is either
male or
female and single or not single. I can get methods like:
group.people.male
group.people.female
group.people.single
By using extensions a la:
class Group < ActiveRecord::Base
has_many :people do
def single
find :all, :conditions=>{:single=>true}
end
end
But what if I wanted methods like:
group.people.female.single
Is there a way to extend the extensions at all? It seems like this
functionality would be very helpful to encapsulate everything so you
don''t end up with methods like
group.people.female_and_single
group.people.male_and_not_single
Thoughts?
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---