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/test/cases/calculations_test.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/test/cases/calculations_test.rb')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index f931b39998..d677ecb763 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -1,10 +1,11 @@ require "cases/helper" +require 'models/club' require 'models/company' require "models/contract" -require 'models/topic' require 'models/edge' -require 'models/club' require 'models/organization' +require 'models/possession' +require 'models/topic' Company.has_many :accounts @@ -503,4 +504,10 @@ class CalculationsTest < ActiveRecord::TestCase Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) assert_equal [7], Company.joins(:contracts).pluck(:developer_id).map(&:to_i) end + + def test_pluck_with_reserved_words + Possession.create!(:where => "Over There") + + assert_equal ["Over There"], Possession.pluck(:where) + end end |