aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-30 15:20:27 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-30 15:20:27 -0800
commitdccf624b643398afdf1b0e048e57f04cb182c55e (patch)
treec009cbd8a62f5c3ac9565162f2e88e1e1dbd9b7e /activerecord
parentc856e25b32f3c2ea198d6f4ac46276a15fd20d80 (diff)
downloadrails-dccf624b643398afdf1b0e048e57f04cb182c55e.tar.gz
rails-dccf624b643398afdf1b0e048e57f04cb182c55e.tar.bz2
rails-dccf624b643398afdf1b0e048e57f04cb182c55e.zip
Ruby 1.8, how does it work?
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation.rb2
-rw-r--r--activerecord/test/cases/relation_test.rb12
2 files changed, 7 insertions, 7 deletions
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