Rails 2.3+Rake: monkey patch method of class used in rake task -
how monkey patch method of class used in rake task? in particular want redefine method synthesis::assetpackage#compress_js
of asset:packager plugin. tried place redefinition in rakefile
in rails_root
, didn't work. i'd rather not change plugin directly.
you have redefine after synthesis gets loaded. guess app's rake tasks (rails.root/lib/tasks/*.rake) loaded after plugins, try moving monkey-patch there.
in general, shouldn't modify rails app's rakefile directly anyway; put custom rake tasks or other customizations lib/tasks/*.rake.
Comments
Post a Comment