I have the following setup:
class NewsItem < ActiveRecord::Base
has_many :connections, :as => :connectable, :dependent => :destroy
has_many :ideas, :through => :connections
The relationship is a has_many :through that is also polymorphic.
I can add ideas to news items with this code:
related_ideas is an array of ideas.
The problem comes when I try to update the ideas for an existing news item.
First I tried this:
This literally does nothing - no log output at all, no DB activity.
Then I tried this:
Again, nothing at all. No error, nada. I would have expected the 'clear' method call to remove the records that associate the news items and the ideas.
What am I doing wrong?