Rails fails to boot due to Devise initializer not loaded
Summary
28acd2b0 adds a reference to Event
in EventFinder
. Event
references User
within the class.
This causes config/initializers/8_metrics.rb
to fail while instrumenting methods on EventFinder
because config/initializers/devise.rb
is not loaded yet.
This happens when in development mode and when metrics are enabled.
What is the current bug behavior?
Rails boot up fails with undefined method devise for...
What is the expected correct behavior?
Rails starts correctly
Possible fixes
-
Adding
extend Devise::Models
toUser
fixes the issue.Not sure if this causes other side-effects when
User
has the devise methods but with devise not fully configured yet. -
Renaming
config/initializers/devise.rb
toconfig/initializers/8_devise.rb
or something else that's alphabetically before8_metrics.rb
also works since this loads devise before the metrics instrumentation.