Skip to content

Reloading Routes before all cause Devise initializers not to be loaded dependent to the order of gem requires #3533

@jklimke

Description

@jklimke

Hi,

i noticed that reloading routes after causes to draw devise routes before all devise initializers have been executed. It possibly depends on the order of the gems within the gemfile. When devise gems are required before rails admin gems, everything runs smooth, if they are after rails_admin the devise initializers are not yet executed and though the devise routes cannot be drawn (e.g. not executing this initializer causes route drawing to fail https://github.com/heartcombo/devise/blob/6d32d2447cc0f3739d9732246b5a5bde98d9e032/lib/devise/rails.rb#L36)

This is the line that causes the route reload. Maybe this could be moved into a callback after finishing reload. The quick fix for me was to include devise before rails admin that causes devise initializers to run prior to rails_admin. maybe as the simplest "fix" this could be emphazized in the docs.

app.reload_routes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions