From 48783ee7fc9eaf2ae19f74f103fbdeb8bad93f58 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Fri, 10 May 2013 19:33:24 +0200 Subject: Add coverage for the fact that pluck without an argument returns all the table's columns. --- activerecord/test/cases/calculations_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord') diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 5e55f27ab6..941e9759ad 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -479,6 +479,11 @@ class CalculationsTest < ActiveRecord::TestCase assert_equal [1,2,3,4], Topic.order(:id).pluck(:id) end + def test_pluck_without_column_names + assert_equal [[1, "Firm", 1, nil, "37signals", nil, 1, nil, ""]], + Company.order(:id).limit(1).pluck + end + def test_pluck_type_cast topic = topics(:first) relation = Topic.where(:id => topic.id) -- cgit v1.2.3