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

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

    It's ugly, but I found that if I put this kind of code at the bottom of environments.rb it always guaranteed correct load-order on startup.

提交回复
热议问题