Created
March 5, 2009 18:35
-
-
Save btakita/74480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: BT - Remove this when this is integrated into RR. | |
#Adding this monkey patch to get around issue with Double R and named scopes | |
RR::DoubleInjection.class_eval do | |
def initialize(subject, method_name) | |
@subject = subject | |
@method_name = method_name.to_sym | |
if object_has_method?(method_name) | |
begin | |
meta.__send__(:alias_method, original_method_name, method_name) | |
rescue NameError => e | |
begin | |
subject.send(method_name) | |
meta.__send__(:alias_method, original_method_name, method_name) | |
rescue NameError => e | |
end | |
end | |
end | |
@doubles = [] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment