From dccf624b643398afdf1b0e048e57f04cb182c55e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 30 Nov 2010 15:20:27 -0800 Subject: Ruby 1.8, how does it work? --- activerecord/lib/active_record/relation.rb | 2 +- activerecord/test/cases/relation_test.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index c31a6e8feb..4bc7f73013 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -329,7 +329,7 @@ module ActiveRecord def scope_for_create @scope_for_create ||= begin if @create_with_value - @create_with_value.reverse_merge(where_values_hash) + where_values_hash.merge @create_with_value else where_values_hash end diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index a9244ae65e..02de0398aa 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -20,8 +20,8 @@ module ActiveRecord end def test_single_values - assert_equal [:limit, :offset, :lock, :readonly, :create_with, :from].sort, - Relation::SINGLE_VALUE_METHODS.sort + assert_equal [:limit, :offset, :lock, :readonly, :create_with, :from].map(&:to_s).sort, + Relation::SINGLE_VALUE_METHODS.map(&:to_s).sort end def test_initialize_single_values @@ -32,8 +32,8 @@ module ActiveRecord end def test_association_methods - assert_equal [:includes, :eager_load, :preload].sort, - Relation::ASSOCIATION_METHODS.sort + assert_equal [:includes, :eager_load, :preload].map(&:to_s).sort, + Relation::ASSOCIATION_METHODS.map(&:to_s).sort end def test_initialize_association_methods @@ -44,8 +44,8 @@ module ActiveRecord end def test_multi_value_methods - assert_equal [:select, :group, :order, :joins, :where, :having, :bind].sort, - Relation::MULTI_VALUE_METHODS.sort + assert_equal [:select, :group, :order, :joins, :where, :having, :bind].map(&:to_s).sort, + Relation::MULTI_VALUE_METHODS.map(&:to_s).sort end def test_multi_value_initialize -- cgit v1.2.3