From 17c7723451eba00eddbacf65e47d151e3ccafa5b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 17 Nov 2010 14:26:14 -0800 Subject: updating CHANGELOG --- activerecord/CHANGELOG | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 11eb47917d..7f54c0fa30 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,14 @@ *Rails 3.1.0 (unreleased)* +* Migrations should use instance methods rather than class methods: + class FooMigration < ActiveRecord::Migration + def up + ... + end + end + + [Aaron Patterson] + * has_one maintains the association with separate after_create/after_update instead of a single after_save. [fxn] -- cgit v1.2.3 From db32b545dadae7808c210cd7ceef949a620490f0 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 19 Nov 2010 11:20:02 -0800 Subject: adding Migration#change to the CHANGELOG --- activerecord/CHANGELOG | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 7f54c0fa30..f1e16ea2c1 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,23 @@ *Rails 3.1.0 (unreleased)* +* Migrations can be defined as reversible, meaning that the migration system +will figure out how to reverse your migration. To use reversible migrations, +just define the "change" method. For example: + + class MyMigration < ActiveRecord::Migration + def change + create_table(:horses) do + t.column :content, :text + t.column :remind_at, :datetime + end + end + end + +Some things cannot be automatically reversed for you. If you know how to +reverse those things, you should define 'up' and 'down' in your migration. If +you define something in `change` that cannot be reversed, an +IrreversibleMigration exception will be raised when going down. + * Migrations should use instance methods rather than class methods: class FooMigration < ActiveRecord::Migration def up -- cgit v1.2.3 From 6bd93f672ac1c0c4cfe708745c925b4bbe666947 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 19 Nov 2010 11:48:23 -0800 Subject: wtf vim --- activerecord/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index f1e16ea2c1..a3e3051b96 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -9,7 +9,7 @@ just define the "change" method. For example: create_table(:horses) do t.column :content, :text t.column :remind_at, :datetime - end + end end end -- cgit v1.2.3 From 0456feab1198456069d4b5a9da221e6fd818e3da Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 23 Nov 2010 14:13:03 -0800 Subject: updating changelog for dup and clone semantics --- activerecord/CHANGELOG | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index a3e3051b96..f46db909ba 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,16 @@ *Rails 3.1.0 (unreleased)* +* ActiveRecord::Base#dup and ActiveRecord::Base#clone semantics have changed +to closer match normal Ruby dup and clone semantics. + +* Calling ActiveRecord::Base#clone will result in a shallow copy of the record, +including copying the frozen state. No callbacks will be called. + +* Calling ActiveRecord::Base#dup will duplicate the record, including calling +after initialize hooks. Frozen state will not be copied, and all associations +will be cleared. A duped record will return true for new_record?, have a nil +id field, and is saveable. + * Migrations can be defined as reversible, meaning that the migration system will figure out how to reverse your migration. To use reversible migrations, just define the "change" method. For example: -- cgit v1.2.3