diff options
author | Aaron Pfeifer <aaron.pfeifer@gmail.com> | 2013-02-26 09:35:03 -0500 |
---|---|---|
committer | Aaron Pfeifer <aaron.pfeifer@gmail.com> | 2013-03-18 22:09:01 -0400 |
commit | a240e526a8b4c5948a1c2a8ec49b6e2d1ad6ad23 (patch) | |
tree | f6639671decafa03597722f77238607b1f31bfbc /activerecord/lib/active_record/schema_dumper.rb | |
parent | 111611b511c27ec29be6a8837de6d8f25cded5a7 (diff) | |
download | rails-a240e526a8b4c5948a1c2a8ec49b6e2d1ad6ad23.tar.gz rails-a240e526a8b4c5948a1c2a8ec49b6e2d1ad6ad23.tar.bz2 rails-a240e526a8b4c5948a1c2a8ec49b6e2d1ad6ad23.zip |
Fix ActiveRecord locking column defaults not getting persisted
When partial inserts are enabled, overridden db defaults are ignored. This
results in locking columns having a nil value for new records if the db default
is null. This happens because the list of changed attributes for new records is
always assumed to be empty.
Solution: When a new record's default attributes are set, also initialize the
list of changed attributes by comparing current values against what's stored as
the column defaults in the database.
Diffstat (limited to 'activerecord/lib/active_record/schema_dumper.rb')
0 files changed, 0 insertions, 0 deletions