diff options
author | Ian Lesperance <ilesperance@pivotallabs.com> | 2012-09-05 18:00:07 -0400 |
---|---|---|
committer | Yves Senn <yves.senn@oxon.ch> | 2013-01-23 15:17:33 +0100 |
commit | b6d49312920c0b3163064e44ca45871c68136b1c (patch) | |
tree | e084e35799a51a65eafb7d7da91ec76c3323883b /activerecord/lib/active_record/relation/calculations.rb | |
parent | 2a5d119b44b1099c939bbf71c99fec5883d05ef7 (diff) | |
download | rails-b6d49312920c0b3163064e44ca45871c68136b1c.tar.gz rails-b6d49312920c0b3163064e44ca45871c68136b1c.tar.bz2 rails-b6d49312920c0b3163064e44ca45871c68136b1c.zip |
Fix pluck when columns/tables are reserved words.
Backport #7536 to fix #8968.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/relation/calculations.rb
Diffstat (limited to 'activerecord/lib/active_record/relation/calculations.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index ceacf93b60..6e887f5203 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -178,7 +178,7 @@ module ActiveRecord # def pluck(column_name) if column_name.is_a?(Symbol) && column_names.include?(column_name.to_s) - column_name = "#{table_name}.#{column_name}" + column_name = "#{connection.quote_table_name(table_name)}.#{connection.quote_column_name(column_name)}" else column_name = column_name.to_s end |