aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-06 19:35:19 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-07 15:03:15 -0800
commit5ecf6922487b5476509af2a89137c3cd3791f7ab (patch)
treeef745a73241f8747a761a4a03d03040ac0d9124b /activerecord
parent45d0d18baef2de739dae89bb7bc79826392bbde5 (diff)
downloadrails-5ecf6922487b5476509af2a89137c3cd3791f7ab.tar.gz
rails-5ecf6922487b5476509af2a89137c3cd3791f7ab.tar.bz2
rails-5ecf6922487b5476509af2a89137c3cd3791f7ab.zip
merge_with_conditions is not necessary because the conditions will already be in the scope_for_create hash in the scope
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/has_one_association.rb9
1 files changed, 0 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb
index bee5700bfc..285c2631ad 100644
--- a/activerecord/lib/active_record/associations/has_one_association.rb
+++ b/activerecord/lib/active_record/associations/has_one_association.rb
@@ -4,21 +4,18 @@ module ActiveRecord
class HasOneAssociation < AssociationProxy #:nodoc:
def create(attrs = {})
new_record do |reflection|
- attrs = merge_with_conditions(attrs)
reflection.create_association(attrs)
end
end
def create!(attrs = {})
new_record do |reflection|
- attrs = merge_with_conditions(attrs)
reflection.create_association!(attrs)
end
end
def build(attrs = {})
new_record do |reflection|
- attrs = merge_with_conditions(attrs)
reflection.build_association(attrs)
end
end
@@ -77,12 +74,6 @@ module ActiveRecord
replace(record, true)
record
end
-
- def merge_with_conditions(attrs={})
- attrs ||= {}
- attrs.update(@reflection.options[:conditions]) if @reflection.options[:conditions].is_a?(Hash)
- attrs
- end
end
end
end