diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 88 |
1 files changed, 85 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index f7de341fbe..69cf1193b6 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,51 @@ ## Rails 4.0.0 (unreleased) ## +* Implemented ActiveRecord::Relation#none method + + The `none` method returns a chainable relation with zero records + (an instance of the NullRelation class). + + Any subsequent condition chained to the returned relation will continue + generating an empty relation and will not fire any query to the database. + + *Juanjo Bazán* + +* Added the `ActiveRecord::NullRelation` class implementing the null + object pattern for the Relation class. *Juanjo Bazán* + +* Added deprecation for the `:dependent => :restrict` association option. + + Please note: + + * Up until now `has_many` and `has_one`, `:dependent => :restrict` + option raised a `DeleteRestrictionError` at the time of destroying + the object. Instead, it will add an error on the model. + + * To fix this warning, make sure your code isn't relying on a + `DeleteRestrictionError` and then add + `config.active_record.dependent_restrict_raises = false` to your + application config. + + * New rails application would be generated with the + `config.active_record.dependent_restrict_raises = false` in the + application config. + + *Manoj Kumar* + +* Added `create_join_table` migration helper to create HABTM join tables + + create_join_table :products, :categories + # => + # create_table :categories_products, :id => false do |td| + # td.integer :product_id, :null => false + # td.integer :category_id, :null => false + # end + + *Rafael Mendonça França* + +* The primary key is always initialized in the @attributes hash to nil (unless + another value has been specified). + * In previous releases, the following would generate a single query with an `OUTER JOIN comments`, rather than two separate queries: @@ -70,7 +116,43 @@ * PostgreSQL hstore types are automatically deserialized from the database. -## Rails 3.2.0 (unreleased) ## + +## Rails 3.2.1 (unreleased) ## + +* The threshold for auto EXPLAIN is ignored if there's no logger. *fxn* + +* Fix possible race condition when two threads try to define attribute + methods for the same class. + + +## Rails 3.2.0 (January 20, 2012) ## + +* Added a `with_lock` method to ActiveRecord objects, which starts + a transaction, locks the object (pessimistically) and yields to the block. + The method takes one (optional) parameter and passes it to `lock!`. + + Before: + + class Order < ActiveRecord::Base + def cancel! + transaction do + lock! + # ... cancelling logic + end + end + end + + After: + + class Order < ActiveRecord::Base + def cancel! + with_lock do + # ... cancelling logic + end + end + end + + *Olek Janiszewski* * 'on' and 'ON' boolean columns values are type casted to true *Santiago Pastorino* @@ -82,7 +164,7 @@ Example: rake db:migrate SCOPE=blog - *Piotr Sarnacki* + *Piotr Sarnacki* * Migrations copied from engines are now scoped with engine's name, for example 01_create_posts.blog.rb. *Piotr Sarnacki* @@ -169,7 +251,7 @@ Client.select(:name).uniq - This also allows you to revert the unqueness in a relation: + This also allows you to revert the uniqueness in a relation: Client.select(:name).uniq.uniq(false) |