aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorTu Hoang <rebyn@me.com>2014-10-30 22:25:01 +0700
committerTu Hoang <rebyn@me.com>2014-10-30 22:25:01 +0700
commit9f48e75ad713a657b1e37cf22fa361ff98a4580a (patch)
treeac4aa7c8c9d2ad5637b4185b8736132889ca9267 /activerecord/test/schema
parent62f96c9e1fdfa5b832073f90e1fe592fbf3163bb (diff)
downloadrails-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.rb1
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|