aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-01-17 18:32:27 -0500
committerGitHub <noreply@github.com>2019-01-17 18:32:27 -0500
commit41dc4d94907914ad8e75444bd3e0ea0a598bfea1 (patch)
tree1d5939d3c49731bda06ec218f0903a56b2fc79a4 /activerecord/test
parent9aa08151924fa6ff1f1c49e987b67012c295c9cc (diff)
parent9905cdc9465c482e193950e2f672c6c6c2e6ded1 (diff)
downloadrails-41dc4d94907914ad8e75444bd3e0ea0a598bfea1.tar.gz
rails-41dc4d94907914ad8e75444bd3e0ea0a598bfea1.tar.bz2
rails-41dc4d94907914ad8e75444bd3e0ea0a598bfea1.zip
Merge pull request #34963 from dylanahsmith/better-composed-of-single-field-query
activerecord: Use a simpler query condition for aggregates with one mapping
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/finder_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index b8ce11a791..4e8f779951 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -951,6 +951,7 @@ class FinderTest < ActiveRecord::TestCase
assert_kind_of Money, zaphod_balance
found_customers = Customer.where(balance: [david_balance, zaphod_balance])
assert_equal [customers(:david), customers(:zaphod)], found_customers.sort_by(&:id)
+ assert_equal Customer.where(balance: [david_balance.amount, zaphod_balance.amount]).to_sql, found_customers.to_sql
end
def test_hash_condition_find_with_aggregate_attribute_having_same_name_as_field_and_key_value_being_aggregate