Browse files

merge_with_conditions is not necessary because the conditions will al…

…ready be in the scope_for_create hash in the scope
  • Loading branch information...
1 parent 45d0d18 commit 5ecf6922487b5476509af2a89137c3cd3791f7ab @jonleighton jonleighton committed with tenderlove Jan 6, 2011
Showing with 0 additions and 9 deletions.
  1. +0 −9 activerecord/lib/active_record/associations/has_one_association.rb
View
9 activerecord/lib/active_record/associations/has_one_association.rb
@@ -4,21 +4,18 @@ module Associations
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 @@ def new_record
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

0 comments on commit 5ecf692

Please sign in to comment.