Displaying 1 result from an estimated 1 matches for "default_content_id".
2006 May 28
1
ActiveRecord: FK constraints problem
Hi all.
I have has_and_belongs_to_many association between models: Section and
Content.
class Section < ActiveRecord::Base
acts_as_tree
has_and_belongs_to_many :contents
belongs_to :default_content, :class_name => ''Content'', :foreign_key =>
''default_content_id'', :dependent => :nullify
end
class Content < ActiveRecord::Base
belongs_to :section
end
When I trying to remove some Content which associated with Section I
have an error related to foreigh key violation:
"PGError: ERROR: update or delete on "contents" violates f...