diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-27 14:18:49 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-27 14:18:49 -0700 |
commit | 997aed24be07f0b34fbc98a77fe1bab38d90fa79 (patch) | |
tree | 5af4bfeb79ba2045db9c58a903c78d66524fe4a0 /activerecord/lib/active_record/relation/query_methods.rb | |
parent | 506b2dad55f43e22f46bd85129b08bfcc7ca25dc (diff) | |
download | rails-997aed24be07f0b34fbc98a77fe1bab38d90fa79.tar.gz rails-997aed24be07f0b34fbc98a77fe1bab38d90fa79.tar.bz2 rails-997aed24be07f0b34fbc98a77fe1bab38d90fa79.zip |
default create_with_value to a hash so we can eliminate conditionals, add test surrounding create_with(nil) behavior
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 7fbbefeea2..d17861f407 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -137,7 +137,7 @@ module ActiveRecord def create_with(value) relation = clone - relation.create_with_value = value && (@create_with_value || {}).merge(value) + relation.create_with_value = value ? create_with_value.merge(value) : {} relation end |