diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-21 14:33:16 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-21 14:41:52 -0200 |
commit | b0a8ef140e4cc95fa5d3888699fd3d72fd720172 (patch) | |
tree | 36e75ffa27dcd74dc0d08382098a552df53fab6d /activerecord/CHANGELOG.md | |
parent | e011258c30b61f30e40fb2d9b2f58eb1f700dfd5 (diff) | |
download | rails-b0a8ef140e4cc95fa5d3888699fd3d72fd720172.tar.gz rails-b0a8ef140e4cc95fa5d3888699fd3d72fd720172.tar.bz2 rails-b0a8ef140e4cc95fa5d3888699fd3d72fd720172.zip |
`has_one` and `belongs_to` accessors don't add ORDER BY to the queries anymore.
Since Rails 4.0, we add an ORDER BY in the `first` method to ensure consistent
results among different database engines. But for singular associations this
behavior is not needed since we will have one record to return. As this
ORDER BY option can lead some performance issues we are removing it for singular
associations accessors.
Fixes #12623.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 9b2e9c4660..a108a1b2a9 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,14 @@ +* `has_one` and `belongs_to` accessors don't add ORDER BY to the queries anymore. + + Since Rails 4.0, we add an ORDER BY in the `first` method to ensure consistent results + among different database engines. But for singular associations this behavior is not needed + since we will have one record to return. As this ORDER BY option can lead some performance + issues we are removing it for singular associations accessors. + + Fixes #12623. + + *Rafael Mendonça França* + * Prepend table name for column names passed to `Relation#select`. Example: |