How to monkey-patch code that gets auto-loaded in Rails?

前端 未结 6 1484
悲&欢浪女
悲&欢浪女 2020-12-14 18:39

I\'m monkey-patching a Rails engine with something like:

SomeClass.class_eval do
  # ...
end

The first time I hit the web site, on developm

6条回答
  •  孤街浪徒
    2020-12-14 19:05

    Have a look at how this gem handles "decorating" aka monkey patching something in an engine or vice versa:

    https://github.com/EPI-USE-Labs/activesupport-decorators

提交回复
热议问题