Max Williams wrote:> If an "Learningobject" belongs to a "Kind", and a kind
has many
> learningobjects, linked in the usual way where a learningobject has a
> kind_id field, can i set up the method_missing stuff so that i can say
>
> Learningobject.find_all_by_kind("some_value")
>
> ?
>
> In a DB i''m working on, previously each learningobect simply had a
> string to represent their kind. I changed this to reference a new
> "kinds" table, but now i''m having problems with
"paginate_by_kind",
> which calls "find_all_by_kind", creating the problem above.
I''ve
> already created get and set methods for kind in learningobject.
>
> thanks! max
Never mind, i worked it out, it''s pretty obvious really (usually
writing
out these questions makes the answer pop into my head a few minutes
after posting, sorry!). I can just call
Learningobject.find_all_by_kind_id
instead. doh.
thanks for reading anyway.
--
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
-~----------~----~----~----~------~----~------~--~---