diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 9f10a31512..c1b849ce68 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,27 @@ +* Handle aliased attributes in ActiveRecord::Relation. + + When using symbol keys, ActiveRecord will now translate aliased attribute names to the actual column name used in the database: + + With the model + + class Topic + alias_attribute :heading, :title + end + + The call + + Topic.where(heading: 'The First Topic') + + should yield the same result as + + Topic.where(title: 'The First Topic') + + This also applies to ActiveRecord::Relation::Calculations calls such as `Model.sum(:aliased)` and `Model.pluck(:aliased)`. + + This will not work with SQL fragment strings like `Model.sum('DISTINCT aliased')`. + + *Godfrey Chan* + * Mute `psql` output when running rake db:schema:load. *Godfrey Chan* |