Displaying 1 result from an estimated 1 matches for "boat_classes".
Did you mean:
boat_class
2007 Oct 15
0
converting from HABTM to has_many :through
...ult of
updating the primary object, so I''ve ended up doing individual
saves/updates on each join model object.
The story is a regatta can include many boat classes, and a boat class
can be included in many regattas.
class Regatta < ActiveRecord::Base
has_many :inclusions
has_many :boat_classes, :through => :inclusions
has_and_belongs_to_many :users
end
class BoatClass < ActiveRecord::Base
has_many :inclusions
has_many :regattas, :through => :inclusions
end
class Inclusion < ActiveRecord::Base
belongs_to :regatta
belongs_to :boat_class
end
Eventually, I''l...