diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 18:08:18 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 18:08:18 +0100 |
commit | 3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775 (patch) | |
tree | 631aebab77a934df61ecfef4c9aaea3d69825eeb /activerecord/CHANGELOG.md | |
parent | d1099540aff6cf00f31dafbbceed1f9fc48780a2 (diff) | |
download | rails-3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775.tar.gz rails-3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775.tar.bz2 rails-3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775.zip |
Changelog and doc updates for the previous changes.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index c9f131c74c..49eb266143 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,24 @@ ## Rails 4.0.0 (unreleased) ## +* `Model.all` now returns an `ActiveRecord::Relation`, rather than an + array of records. Use `Model.to_a` or `Relation#to_a` if you really + want an array. + + In some specific cases, this may cause breakage when upgrading. + However in most cases the `ActiveRecord::Relation` will just act as a + lazy-loaded array and there will be no problems. + + Note that calling `Model.all` with options (e.g. + `Model.all(conditions: '...')` was already deprecated, but it will + still return an array in order to make the transition easier. + + `Model.scoped` is deprecated in favour of `Model.all`. + + `Relation#all` still returns an array, but is deprecated (since it + would serve no purpose if we made it return a `Relation`). + + *Jon Leighton* + * Deprecate `update_column` method in favor of `update_columns`. *Rafael Mendonça França* @@ -249,13 +268,12 @@ Note that as an interim step, it is possible to rewrite the above as: - Post.scoped(:where => { :comments_count => 10 }, :limit => 5) + Post.all.merge(:where => { :comments_count => 10 }, :limit => 5) This could save you a lot of work if there is a lot of old-style finder usage in your application. - Calling `Post.scoped(options)` is a shortcut for - `Post.scoped.merge(options)`. `Relation#merge` now accepts a hash of + `Relation#merge` now accepts a hash of options, but they must be identical to the names of the equivalent finder method. These are mostly identical to the old-style finder option names, except in the following cases: |