aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2015-11-15 23:56:52 +0900
committeryui-knk <spiketeika@gmail.com>2015-11-16 23:15:45 +0900
commit817c1825c15013fd0180762ac5c05a2e024a640d (patch)
treeb27701f790e2c7d2e6fcaff93724025de4fb5557 /activerecord/test/schema
parent69f72223e82a4a4f16f16ad7abb36ebfd162a366 (diff)
downloadrails-817c1825c15013fd0180762ac5c05a2e024a640d.tar.gz
rails-817c1825c15013fd0180762ac5c05a2e024a640d.tar.bz2
rails-817c1825c15013fd0180762ac5c05a2e024a640d.zip
Except keys of `build_record`'s argument from `create_scope` in initialize_attributes
If argument of `build_record` has key and value which is same as default value of database, we should also except the key from `create_scope` in `initialize_attributes`. Because at first `build_record` initialize record object with argument of `build_record`, then assign attributes derived from Association's scope. In this case `record.changed` does not include the key, which value is same as default value of database, so we should add the key to except list. Fix #21893.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 66a1f5aa8a..99098017d7 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -114,7 +114,7 @@ ActiveRecord::Schema.define do
create_table :bulbs, force: true do |t|
t.integer :car_id
t.string :name
- t.boolean :frickinawesome
+ t.boolean :frickinawesome, default: false
t.string :color
end