Hi,
I can't make self referential has_many :through associations work:
base_production.suggestions << suggested_production
, where suggestions are stored in SQL: table: suggestionships column (production_id, suggestion_id) Rails: class Suggestionship < ActiveRecord::Base belongs_to :production belongs_to :suggestion , :class_name => 'Production' end
PROBLEM: 'suggestion_id' is NULL, whenever a new 'suggestionship' is created with foo.suggestions << bar
THE MODEL :
class Production < ActiveRecord::Base has_many :suggestionships has_many :suggestions , :through => :suggestionships , :source => :production end
It must be obvious but I can't see it. Any idea? TIA
Alain