Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set_owner_attributes is covered by the scoping

  • Loading branch information...
commit 8f50bbee31ca4b2cc2ac9b9889c421f6a38d97f4 1 parent c86a32d
@jonleighton jonleighton authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 activerecord/lib/active_record/associations/collection_proxy.rb
View
7 activerecord/lib/active_record/associations/collection_proxy.rb
@@ -84,10 +84,9 @@ def respond_to?(name, include_private = false)
def method_missing(method, *args, &block)
match = DynamicMatchers::Method.match(self, method)
if match && match.is_a?(DynamicMatchers::Instantiator)
- super do |r|
- proxy_association.send :set_owner_attributes, r
- proxy_association.send :add_to_target, r
- yield(r) if block_given?
+ super do |record|
+ proxy_association.add_to_target(record)
+ yield record if block_given?
end
elsif target.respond_to?(method) || (!proxy_association.klass.respond_to?(method) && Class.respond_to?(method))
Please sign in to comment.
Something went wrong with that request. Please try again.