aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-03-09 17:28:38 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-03-09 17:29:04 +0900
commita0438ad46aaed711dbc0331847357c87021b4f01 (patch)
treeb7c3be688f9271e5f12b89492dc6a80ac1d8ab8f /activerecord/test
parenteec723f69ad0e2e957f9c9bca350a6e032c1b58f (diff)
parent6f4e66fefbcbf79351f41db0a75bf8aace43c1b7 (diff)
downloadrails-a0438ad46aaed711dbc0331847357c87021b4f01.tar.gz
rails-a0438ad46aaed711dbc0331847357c87021b4f01.tar.bz2
rails-a0438ad46aaed711dbc0331847357c87021b4f01.zip
Merge pull request #32213 from yujideveloper/feature/delegate-ar-base-pick-to-all
Add `delegate :pick, to: :all`
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/calculations_test.rb5
1 files changed, 5 insertions, 0 deletions
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!