4 Jul 11:57
save! not allowed after validates_uniqueness
I have this in a model
validates_uniqueness_of :aspect, :scope => :user_id
In an instance method of the same model I have "save!" but I don't touch
the :aspect attribute in that instance method at all.
Whenever that save! command is run however I get this error:
ActiveRecord::RecordInvalid: Validation failed: Aspect has
already been taken
I don't understand. The validation should not skip the instance from
which the method is called. Please help. Thanks.
--
--
Posted via http://www.ruby-forum.com/.
RSS Feed