From 9f48e75ad713a657b1e37cf22fa361ff98a4580a Mon Sep 17 00:00:00 2001 From: Tu Hoang Date: Thu, 30 Oct 2014 22:25:01 +0700 Subject: =?UTF-8?q?Add=20specs=20for=20adding-to/clear=20has=5Fmany=20coll?= =?UTF-8?q?ections=E2=80=99s=20behavior=20on=20`updated=5Fat`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- activerecord/test/schema/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/schema') 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| -- cgit v1.2.3