Is it possible to make some kinda this association:
User model:
has_many :goods, :through => :assignments
has_many :goods_want, :through => :assignments, :source => :good, :conditions => "assignments.type = 1"
Testing in console
u = User.first
u.goods_want << Good.first
u.save
This is being logged:
INSERT INTO `assignments` (`good_id`, `updated_at`, `type`, `profile_id`, `created_at`) VALUES(1, '2009-03-26 09:36:11', NULL, 1, '2009-03-26 09:36:11')
So is there any beautiful way to make this association work not only to get records from database, but to write into database?