lib/contrast/framework/rails/support.rb in contrast-agent-6.4.0 vs lib/contrast/framework/rails/support.rb in contrast-agent-6.5.0

- old
+ new

@@ -133,11 +133,14 @@ # # @param route [Object] app or route that points to a ::Rails::Engine # @return [bool] whether the router is an engine or not. def engine_route? route return false unless route&.app&.app + return false unless route.app.is_a?(::ActionDispatch::Routing::Mapper::Constraints) || + route.app.is_a?(::ActionDispatch::Routing::RouteSet::Dispatcher) - route.app.is_a?(::ActionDispatch::Routing::Mapper::Constraints) && route.app.app < ::Rails::Engine + clazz = route.app.app.is_a?(Class) ? route.app.app : route.app.app.cs__class + clazz < ::Rails::Engine end # Recursively get final route traversing engines as required. Because this can only be called once, we store # this match for the duration of our request context. #