Monday, November 7, 2011

[Rails] has_and_belongs_to_many or has_many :through?

I always has doubts on using has_and_belongs_to_many rather than
has_many :through association.
I have a model like this:

class Company < ActiveRecord::Base
has_many :categories
has_many :legal_representatives
has_many :tenders
has_many :documents
end

I don't see any way to use another model for these associations, do
you think it's better to use has_many :through anyway?

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate