From 7ae26885d96daee3809d0bd50b1a440c2f5ffb69 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 29 Jan 2018 21:28:42 +0900 Subject: Deprecate `expand_hash_conditions_for_aggregates` This can not expand an array of aggregated objects correctly, and is no longer used internally since 159b21b5. --- activerecord/test/cases/sanitize_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/sanitize_test.rb b/activerecord/test/cases/sanitize_test.rb index 1b0605e369..778cf86ac3 100644 --- a/activerecord/test/cases/sanitize_test.rb +++ b/activerecord/test/cases/sanitize_test.rb @@ -4,6 +4,7 @@ require "cases/helper" require "models/binary" require "models/author" require "models/post" +require "models/customer" class SanitizeTest < ActiveRecord::TestCase def setup @@ -167,6 +168,12 @@ class SanitizeTest < ActiveRecord::TestCase assert_equal "#{ActiveRecord::Base.connection.quote('10')}::integer '2009-01-01'::date", l.call end + def test_deprecated_expand_hash_conditions_for_aggregates + assert_deprecated do + assert_equal({ "balance" => 50 }, Customer.send(:expand_hash_conditions_for_aggregates, balance: Money.new(50))) + end + end + private def bind(statement, *vars) if vars.first.is_a?(Hash) -- cgit v1.2.3