Skip to content

Commit

Permalink
Merge pull request #491 from danmayer/fix_for_489
Browse files Browse the repository at this point in the history
fix for #489 not loading the route tracking in some apps
  • Loading branch information
danmayer authored Nov 12, 2023
2 parents 0017805 + 87a9b9c commit f7a81c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/coverband/collectors/route_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def railtie!

def concrete_target
if defined?(Rails.application)
if Rails.application.respond_to?(:reload_routes!) && Rails.application.routes.empty?
# NOTE: depending on eager loading etc, routes may not be loaded
# so load them if they aren't
Rails.application.reload_routes!
end
Rails.application.routes.routes.map do |route|
{
controller: route.defaults[:controller],
Expand Down

0 comments on commit f7a81c9

Please sign in to comment.