Ruby on Rails Thursday, March 29, 2012

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@googlegroups.com.
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.

No comments:

Post a Comment