Robert Walker wrote:
> Jon Cox wrote:
>> ooh found 'has_many_and_belongs_to' in ActiveRecord that takes care of 
>> the match->match_game<-game relationship nicely!
> 
> The current trend in Rails is toward has_many :through instead of 
> has_and_belongs_to_many (HABTM). 

Says who?  I tend to start with HABTM and refactor to has_many :through 
if necessary.

> The has_many :trough is more flexible, 
> and often more RESTful.

More flexible, yes.  But it's not the Simplest Thing That Could Possibly 
Work [TM] in this case.

HABTM is a special simplified case.  If your data fits the special case, 
it makes sense to take advantage of it.

As for REST, that's a routing issue, not an associations issue.

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to