A proposed fix could be to not set the default for @@mount_at or to interpret config.mount_at = false or config.mount_at = nil as a switch to disable auto mounting.
Of course it would also be needed to fix all calls to rails_performance_path.
I could do a pull request to implement either of these solutions if it suits your needs, or let me know if I missed anything 😄
How to reproduce :
mount RailsPerformance::Engine
in routes.rb to a specific route (let's say/dashboard/performance
)config.mount_at
line in initializer/rails/performance
and/dashboard/performance
Looks like to culprit is https://github.com/igorkasyanchuk/rails_performance/blob/624f82915132a6a974033e49329478ff6dccd93b/lib/rails_performance.rb#L61 as it always sets a default that is then used by https://github.com/igorkasyanchuk/rails_performance/blob/624f82915132a6a974033e49329478ff6dccd93b/config/routes.rb#L21
A proposed fix could be to not set the default for
@@mount_at
or to interpretconfig.mount_at = false
orconfig.mount_at = nil
as a switch to disable auto mounting.Of course it would also be needed to fix all calls to
rails_performance_path
.I could do a pull request to implement either of these solutions if it suits your needs, or let me know if I missed anything 😄
Have a great day