1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/active_record/validations
Joe Rafaniello 0379da6abc Fix uniqueness validation with an after_create hook.
record.id_was is nil in after_create/after_save, so we should use
id in these cases.

While this logic feels incomplete, the existing update_record uses the same
logic:
2fda4e0874/activerecord/lib/active_record/relation.rb (L83)

This logic was originally added for a similar problem:
updates not working with after_create hook.

See: 482f8c15b1

Followup to #23581
Fixes #23844
2016-02-25 10:13:12 -05:00
..
absence.rb Revert changes to validations from PR #18612 2016-02-23 15:21:46 -05:00
associated.rb Improve support for non Active Record objects on validates_associated 2015-11-08 10:58:39 -02:00
length.rb Revert changes to validations from PR #18612 2016-02-23 15:21:46 -05:00
presence.rb Revert changes to validations from PR #18612 2016-02-23 15:21:46 -05:00
uniqueness.rb Fix uniqueness validation with an after_create hook. 2016-02-25 10:13:12 -05:00