chiru4all
2012-Mar-29 19:19 UTC
Rails 3 association with order by field with belongs to relation
Hi,
I have three model subject, document_types and document.
class Subject < AR
has_many :documents
end
class DocumenType < AR
has_many :documents
end
class Document < AR
belongs_to :subject
belongs_to :document_types
end
I need to list all the documents under a subject order by
document_type''s start_date.
What is exact syntax I will use in this association to solve this
problem.
Thanks in advance.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.