diff options
author | Tu Hoang <rebyn@me.com> | 2014-10-30 22:25:01 +0700 |
---|---|---|
committer | Tu Hoang <rebyn@me.com> | 2014-10-30 22:25:01 +0700 |
commit | 9f48e75ad713a657b1e37cf22fa361ff98a4580a (patch) | |
tree | ac4aa7c8c9d2ad5637b4185b8736132889ca9267 /activerecord/test/schema | |
parent | 62f96c9e1fdfa5b832073f90e1fe592fbf3163bb (diff) | |
download | rails-9f48e75ad713a657b1e37cf22fa361ff98a4580a.tar.gz rails-9f48e75ad713a657b1e37cf22fa361ff98a4580a.tar.bz2 rails-9f48e75ad713a657b1e37cf22fa361ff98a4580a.zip |
Add specs for adding-to/clear has_many collections’s behavior on `updated_at`
There are behaviors mentioned in #17161 that:
1. are not documented properly, and
2. don't have specs
This commit addresses the spec absence. For has_many collections,
1. addition (<<) should update the associated object's updated_at (if any)
2. .clear, depending on options[:dependent], calls delete_all, destroy_all, or nullifies the associated object(s)' foreign key.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/schema.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index 10de3d34cb..5e0c0b889a 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -650,6 +650,7 @@ ActiveRecord::Schema.define do create_table :ship_parts, force: true do |t| t.string :name t.integer :ship_id + t.datetime :updated_at end create_table :speedometers, force: true, id: false do |t| |