lockup icon indicating copy to clipboard operation
lockup copied to clipboard

Update lockup_controller.rb

Open oz-tal opened this issue 3 years ago • 2 comments

fix check_for_lockup not defined during rails init. I've encountered this issue after an a upgrade from rails 4 to rails 5.

oz-tal avatar Jun 28 '22 19:06 oz-tal

I’m hesitating on this addition considering Rails 5 has been out for awhile and we haven’t heard that anyone else needed this modification… 🤔

Could something else in your config be causing it?

gblakeman avatar Jun 30 '22 16:06 gblakeman

Thanks for the quick return. It's possible indeed I have some odd config, the gem is used on an old project with a complicated history.

I'm upgrading from rails 5 to 6 too, I'll try to identify why the problem occur and if it's still an issue after the next upgrade.

I will keep you up-to-date!

oz-tal avatar Jul 02 '22 20:07 oz-tal

Closing this as stale.

gblakeman avatar Oct 18 '23 18:10 gblakeman

It been a while, but I finally came around to work on the issue, thought I'd give you the update I promised.

The problem actually originated from a monkey-patch being injected too early from an initializer.

From my understanding, the issue stem from the fact the controller depend on the method check_for_lockup from lib/lockup.rb, but doesn't actually require/include it in any explicit way. Thus, patching the controller before everything is loaded blow up the app.

I believe this could be fixed, but it's very much an edge case.

For posterity the offending monkey-patch was simply fixed by wrapping it with Rails.application.config.after_initialize {}.

oz-tal avatar Nov 08 '23 23:11 oz-tal