diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-09 13:50:08 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-09 13:50:08 -0800 |
commit | e0cba3a0fab28f96dc9b5d3a714886583873a7d3 (patch) | |
tree | 8712fd8f0b53b7916ae8549decb86928302f00dc /activerecord/test/cases/calculations_test.rb | |
parent | 6c50c07d8dbb0b014e68608fe72f807cbe7f5c45 (diff) | |
parent | e6c98b83cbf4eab8944601754cc8d0e627b55d6f (diff) | |
download | rails-e0cba3a0fab28f96dc9b5d3a714886583873a7d3.tar.gz rails-e0cba3a0fab28f96dc9b5d3a714886583873a7d3.tar.bz2 rails-e0cba3a0fab28f96dc9b5d3a714886583873a7d3.zip |
Merge branch 'master' into instance_reader
* master: (30 commits)
Bump tzinfo. 0.3.31 was released on November 6, 2011.
Fix GH #4909. Dependency on TZInfo move from AR to AS.
moving ordered hash to normal hash because ruby 1.9.3 hash defaultly ordered one
Refactored the OrderedHash related stuff
Replaced OrderedHash usage with Ruby 1.9 Hash
Replaced OrderedHash with Hash for ruby 1.9 series
removed unnecessary code
replacing the orderhash with hash for ruby-1.9
Clean up some wording.
Fix typo.
test title changed corresponding to the test
replaced active support ordered hash to ruby hash on active resource
PostgreSQL does not work in the same way of the other adapters
AR::Relation#pluck: improve to work with joins
Fix match docs
Fix attribute_before_type_cast for serialized attributes. Fixes #4837.
Fix failing request test
Fixes in AMo README
Update README to mention lint.
Trim down Active Model API by removing valid? and errors.full_messages
...
Diffstat (limited to 'activerecord/test/cases/calculations_test.rb')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 7c9ebf528e..e1544b3b00 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -478,4 +478,19 @@ class CalculationsTest < ActiveRecord::TestCase def test_pluck_with_qualified_column_name assert_equal [1,2,3,4], Topic.order(:id).pluck("topics.id") end + + def test_pluck_auto_table_name_prefix + c = Company.create!(:name => "test", :contracts => [Contract.new]) + assert_equal [c.id], Company.joins(:contracts).pluck(:id) + end + + def test_pluck_not_auto_table_name_prefix_if_column_joined + Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # FIXME: PostgreSQL should works in the same way of the other adapters + if current_adapter?(:PostgreSQLAdapter) + assert_equal ["7"], Company.joins(:contracts).pluck(:developer_id) + else + assert_equal [7], Company.joins(:contracts).pluck(:developer_id) + end + end end |