diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-29 15:37:16 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-29 15:37:16 -0800 |
commit | 1337e9284c038de8f0ea8a2de0d03efa630ea057 (patch) | |
tree | c6003ed0aa0fa8d55468952192cd053f41f73d33 /activerecord/lib/active_record | |
parent | 1683afb0ae093999d7ca24b87181c4e0109f1f56 (diff) | |
parent | b6d49312920c0b3163064e44ca45871c68136b1c (diff) | |
download | rails-1337e9284c038de8f0ea8a2de0d03efa630ea057.tar.gz rails-1337e9284c038de8f0ea8a2de0d03efa630ea057.tar.bz2 rails-1337e9284c038de8f0ea8a2de0d03efa630ea057.zip |
Merge pull request #9043 from senny/backport_7536
Backport: Fix pluck when columns/tables are reserved words.
Diffstat (limited to 'activerecord/lib/active_record')
-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 |