From a98475c2df8ab7d7d353cb29bb3f201c4c7eb9d1 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Wed, 11 Nov 2015 15:15:26 +0900 Subject: Make `AR::SpawnMethods#merge!` to check an arg is a Proc From Ruby ( 2.3.0dev trunk 52520), `Hash#to_proc` is defined (https://github.com/ruby/ruby/commit/fbe967ec02cb65a7efa3fb8f3d747cf6f620dde1), and many tests have been failed with `ArgumentError: wrong number of arguments (given 0, expected 1)`. Because we call `Hash#to_proc` with no args in `#merge!`. This commit changes order of conditionals to not call `Hash#to_proc`. --- activerecord/test/cases/relation_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index 8794bc8043..b58052a962 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -24,6 +24,10 @@ module ActiveRecord def self.sanitize_sql_for_order(sql) sql end + + def self.arel_table + Post.arel_table + end end def test_construction -- cgit v1.2.3