aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-30 15:48:15 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-30 15:48:15 -0800
commitae6033331fe78cf5b3af04e1f6f930b98ddab66f (patch)
tree7accd8b1bb016e2a77e91f9f28aeb41683ace9af /activerecord
parentb293ab7c618f65e06371e9ae7b00fe2a65082209 (diff)
downloadrails-ae6033331fe78cf5b3af04e1f6f930b98ddab66f.tar.gz
rails-ae6033331fe78cf5b3af04e1f6f930b98ddab66f.tar.bz2
rails-ae6033331fe78cf5b3af04e1f6f930b98ddab66f.zip
shorten up scope_for_create
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index 4bc7f73013..8d0d99a125 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -327,13 +327,7 @@ module ActiveRecord
end
def scope_for_create
- @scope_for_create ||= begin
- if @create_with_value
- where_values_hash.merge @create_with_value
- else
- where_values_hash
- end
- end
+ @scope_for_create ||= where_values_hash.merge(@create_with_value || {})
end
def eager_loading?