Skip to content

Commit

Permalink
remove unnecessary conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Sep 23, 2010
1 parent 931dab7 commit 04e46d5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/mongo_mapper/plugins/associations/proxy.rb
Expand Up @@ -26,7 +26,7 @@ def initialize(owner, association)
end

# Active support in rails 3 beta 4 can override to_json after this is loaded,
# at least when run in mongomapper tests. The implementation was changed in master
# at least when run in mongomapper tests. The implementation was changed in master
# some time after this, so not sure whether this is still a problem.
#
# In rails 2, this isn't a problem however it also solves an issue where
Expand All @@ -41,7 +41,7 @@ def as_json(*options)
load_target
target.as_json(*options)
end

def inspect
load_target
target.inspect
Expand Down Expand Up @@ -106,11 +106,7 @@ def ===(other)
protected
def method_missing(method, *args, &block)
if load_target
if block_given?
target.send(method, *args) { |*block_args| block.call(*block_args) }
else
target.send(method, *args)
end
target.send(method, *args, &block)
end
end

Expand Down

0 comments on commit 04e46d5

Please sign in to comment.