diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 87 |
1 files changed, 77 insertions, 10 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 1e035c11e0..4222308f8b 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,13 +1,81 @@ -* Update counter cache on a has_many relationship regardless of default scope +* Polymorphic `belongs_to` associations with the `touch: true` option set update the timestamps of + the old and new owner correctly when moved between owners of different types. + + Example: + + class Rating < ActiveRecord::Base + belongs_to :rateable, polymorphic: true, touch: true + end + + rating = Rating.create rateable: Song.find(1) + rating.update_attributes rateable: Book.find(2) # => timestamps of Song(1) and Book(2) are updated + + *Severin Schoepke* + +* Improve formatting of migration exception messages: make them easier to read + with line breaks before/after, and improve the error for pending migrations. + + *John Bachir* + +* Fix `last` with `offset` to return the proper record instead of always the last one. + + Example: + + Model.offset(4).last + # => returns the 4th record from the end. + + Fixes #7441. + + *kostya*, *Lauro Caetano* + +* `type_to_sql` returns a `String` for unmapped columns. This fixes an error + when using unmapped array types in PG + + Example: + + change_colum :table, :column, :bigint, array: true + + Fixes #13146. + + *Jens Fahnenbruck*, *Yves Senn* + +* Fix `QueryCache` to work with nested blocks, so that it will only clear the existing cache + after leaving the outer block instead of clearing it right after the inner block is finished. + + *Vipul A M* + +* The ERB in fixture files is no longer evaluated in the context of the main + object. Helper methods used by multiple fixtures should be defined on the + class object returned by `ActiveRecord::FixtureSet.context_class`. + + *Victor Costan* + +* Previously, the `has_one` macro incorrectly accepted the `counter_cache` + option, but never actually supported it. Now it will raise an `ArgumentError` + when using `has_one` with `counter_cache`. + + *Godfrey Chan* + +* Implement `rename_index` natively for MySQL >= 5.7. + + *Cody Cutrer* + +* Fix bug when validating the uniqueness of an aliased attribute. + + Fixes #12402. + + *Lauro Caetano* + +* Update counter cache on a `has_many` relationship regardless of default scope. Fix #12952. *Uku Taht* -* `rename_index` adds the new index before removing the old one. This allows - to rename indexes on columns with a foreign key and prevents the following error: +* `rename_index` adds the new index before removing the old one. This allows to + rename indexes on columns with a foreign key and prevents the following error: - `Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint` + Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint *Cody Cutrer*, *Yves Senn* @@ -17,7 +85,6 @@ *Brian Thomas Storti* - * Fix validation on uniqueness of empty association. *Evgeny Li* @@ -719,11 +786,11 @@ *Neeraj Singh* -* Removed deprecated method `scoped` +* Removed deprecated method `scoped`. *Neeraj Singh* -* Removed deprecated method `default_scopes?` +* Removed deprecated method `default_scopes?`. *Neeraj Singh* @@ -758,7 +825,7 @@ *Jon Leighton* -* Remove `activerecord-deprecated_finders` as a dependency +* Remove `activerecord-deprecated_finders` as a dependency. *Łukasz Strzałkowski* @@ -844,7 +911,7 @@ class Author < ActiveRecord::Base has_many :posts - has_many :taggings, :through => :posts + has_many :taggings, through: :posts end class Post < ActiveRecord::Base @@ -859,7 +926,7 @@ class Author < ActiveRecord::Base has_many :posts - has_many :taggings, :through => :posts, :source => :tagging + has_many :taggings, through: :posts, source: :tagging end class Post < ActiveRecord::Base |