Skip to content

Commit

Permalink
Make a clear destinction between Rails::Application and Rails::Engine…
Browse files Browse the repository at this point in the history
… when reloading routes
  • Loading branch information
bogdan committed Nov 15, 2024
1 parent fea24c9 commit 4bc9dd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/js_routes/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ def generate

application = T.unsafe(self.application)
if named_routes.empty?
if Rails.version >= "8.0.0"
application.reload_routes_unless_loaded
elsif application.respond_to?(:reload_routes!, true)
application.reload_routes!
if application.is_a?(Rails::Application)
if Rails.version >= "8.0.0"
application.reload_routes_unless_loaded
else
application.reload_routes!
end
end
end
content = File.read(@configuration.source_file)
Expand Down

0 comments on commit 4bc9dd0

Please sign in to comment.