add_multiple_associated_save_callbacks and validates_associated conflict?

Perhaps I'm misunderstanding what's happening here, but I'm having a problem with not being able to disable the validation of an associated collection if that collection contains a new record. Example...

class Person < ActiveRecord::Base      has_many :email_addresses      validates_associated :email_addresses, :if => Proc.new { false } end

p = Person.new p.email_addresses.build p.save (will return false and give you a validation error on email_addresses)

There's a validation set up by add_multiple_associated_save_callbacks in ActiveRecord::Associations::ClassMethods that sends 'valid?' to any new records in the collection, which pretty much negates the usefulness of having validates_associated accept if and unless parameters in the first place.

If anyone else has run into this, I'd like to see whatever workarounds you've come up with.

AckZ wrote:

There's a validation set up by add_multiple_associated_save_callbacks in ActiveRecord::Associations::ClassMethods that sends 'valid?' to any new records in the collection, which pretty much negates the usefulness of having validates_associated accept if and unless parameters in the first place.

If anyone else has run into this, I'd like to see whatever workarounds you've come up with.

http://groups.google.com/group/rubyonrails-talk/msg/553ac81685757842