1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test
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
..
active_record/connection_adapters introduce conn.data_source_exists? and conn.data_sources. 2015-09-22 19:48:44 +02:00
assets
cases Fix uniqueness validation with an after_create hook. 2016-02-25 10:13:12 -05:00
fixtures Fixed where for polymorphic associations when passed an array containing different types. 2016-02-16 10:41:26 -08:00
migrations Internal test migrations use the private 'Current' version 2015-12-15 17:18:09 +10:30
models Ensure suppressor runs before validations 2016-02-24 14:33:22 -05:00
schema Merge pull request #23628 from maclover7/fix-23625 2016-02-23 12:24:07 -07:00
support Deprecate #table_exists?, #tables and passing arguments to #talbes 2015-11-09 23:13:23 +09:00
.gitignore
config.example.yml Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
config.rb