Displaying 1 result from an estimated 1 matches for "tunescontroller".
2008 Sep 18
1
"xxx_id may not be null" when saving many to many joined objects
...pendent => :destroy
has_many :titles, :through => :variations
...
class Title < ActiveRecord::Base
has_many :variations, :dependent => :destroy
has_many :tunes, :through => :variations
...
class Variation < ActiveRecord::Base
belongs_to :tune
belongs_to :title
...
In my TunesController I create a new Tune, Variation and Title. I set the
:tune and :title attributes in the Variation, and add the Variation to the
tune and title''s :variations arrays.
The problem is that when I save the Tune, I get the following error:
SQLite3::SQLException: variations.title_id may not be NU...