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

前端 未结 6 1423
悲&欢浪女
悲&欢浪女 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:27

    If you place the patch in any .rb file inside /config/initializers, it should work.

提交回复
热议问题