Forum: Ruby on Rails HABTM relationship

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F1f614e92a13c98f3285533ee5a8ba5c?d=identicon&s=25 Andy Wiens (Guest)
on 2006-03-23 21:33
Hi all,

I've got the following two objects and the habtm relationship isn't
putting records in the DB:

class Cse < ActiveRecord::Base
  has_and_belongs_to_many :conditions
end

class Condition < ActiveRecord::Base
  has_and_belongs_to_many :cses
end

I'm creating a Cse object and filling the collection of Conditions, then
calling save on the Cse object.  Nothing is getting saved in the
conditions_cses table.  Is there anyway to do fill the collection of
conditions prior to saving the cse object?
This topic is locked and can not be replied to.