Using collection<< on has_many with :conditions.


I have a has_many relation with a hashed condition, taking from the RI doc:

:conditions            Specify the conditions that the associated objects must            meet in order to be included as a WHERE SQL fragment, such            as price > 5 AND name LIKE 'B%'. Record creations from the            association are scoped if a hash is used. has_many :posts,            :conditions => {:published => true} will create published            posts with @blog.posts.create or

I wonder why the behaviour of @blog.posts<< is not also modified when using hashed conditions. The thing is when I have :conditions => {:published => true}

and issue @blog.posts.create(:published => false) will result in a new (published) post, i.e. it will override the :published attributes, the same holds for => false), but when I do a @blog.posts << => false), it will not be overruled by my condition, it will not even fail my condition. It will simply end up in the database outside the scope of the condition.

Is this a design decision (of the has_many :condition attribute)? or is this actually a bug/feature request?