I have a module that is included in a model. In this module, there is a foo
method that I would like to override without modifying the existing model and module code.
My idea was to create a file /lib/my_module_extend.rb
.
I don't know how to override the method in question because it's not like overriding a method in a class. I usually do:
module MyOriginalClassExtend
...
end
MyOriginalClass.class_eval do
prepend(MyOriginalClassExtend)
end
but class_eval
is not possible for a module. Do you have any idea?