Last active
April 13, 2016 11:06
-
-
Save rknLA/f38fef042db59b2a3b59a968819ede5c 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
class BarContoller | |
def update | |
# ... | |
SomeExternalModule::SomeClassInTheModule.my_method | |
# kaboom: | |
# NoMethodError (undefined method `my_method' for #<Class:0x007fd3964eb468>): | |
end | |
end |
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
module SomeExternalModule | |
class SomeClassInTheModule # which inherits ActiveRecord::Base | |
def self.my_method | |
# do whatever here... | |
end | |
end | |
end |
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
#? lxsameer's suggestion | |
SomeExternalModule::SomeExternalClass.class_eval do | |
def my_method | |
# do whatever here... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment