From 6f4e66fefbcbf79351f41db0a75bf8aace43c1b7 Mon Sep 17 00:00:00 2001 From: Yuji Hanamura Date: Fri, 9 Mar 2018 16:04:56 +0900 Subject: Add `delegate :pick, to: :all` --- activerecord/test/cases/calculations_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 74228b2796..080d2a54bc 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -811,6 +811,11 @@ class CalculationsTest < ActiveRecord::TestCase assert_nil Topic.where("1=0").pick(:author_name, :author_email_address) end + def test_pick_delegate_to_all + cool_first = minivans(:cool_first) + assert_equal cool_first.color, Minivan.pick(:color) + end + def test_grouped_calculation_with_polymorphic_relation part = ShipPart.create!(name: "has trinket") part.trinkets.create! -- cgit v1.2.3