Skip to content

Commit

Permalink
Revert "Fix instance_eval calls to association proxies"
Browse files Browse the repository at this point in the history
I think it may of broke the build. Lets see.

This reverts commit 49e943c.

Conflicts:

	activerecord/test/cases/associations/has_many_associations_test.rb
  • Loading branch information
josh committed Dec 13, 2009
1 parent 39b708b commit 8a50f8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -200,14 +200,18 @@ def with_scope(*args, &block)

private
# Forwards any missing method call to the \target.
def method_missing(method, *args, &block)
def method_missing(method, *args)
if load_target
unless @target.respond_to?(method)
message = "undefined method `#{method.to_s}' for \"#{@target}\":#{@target.class.to_s}"
raise NoMethodError, message
end

@target.send(method, *args, &block)
if block_given?
@target.send(method, *args) { |*block_args| yield(*block_args) }
else
@target.send(method, *args)
end
end
end

Expand Down
Expand Up @@ -1187,4 +1187,3 @@ def test_instance_eval_in_association_proxy
assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.sort_by(&:id).first.instance_eval{title}
end
end

0 comments on commit 8a50f8a

Please sign in to comment.