Skip to content

Commit

Permalink
fix Rails 5 rc1 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
simi committed May 13, 2016
1 parent b12870d commit a1816d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/routing_filter/adapters/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def clear!

ActionDispatch::Journey::Routes.class_eval do
def filters
@filters || RoutingFilter::Chain.new.tap { |f| @filters = f unless frozen? }
@filters ||= RoutingFilter::Chain.new.tap { |f| @filters = f unless frozen? }
end
end

Expand Down
8 changes: 1 addition & 7 deletions lib/routing_filter/adapters/routers/journey.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
ActionDispatch::Journey::Routes.class_eval do
def filters
@filters || RoutingFilter::Chain.new.tap { |f| @filters = f unless frozen? }
end
end

module ActionDispatchJourneyRouterWithFiltering
def find_routes(env)
path = env.is_a?(Hash) ? env['PATH_INFO'] : env.path_info
Expand All @@ -27,4 +21,4 @@ def find_routes(env)
end
end

ActionDispatch::Journey::Router.send(:prepend, ActionDispatchJourneyRouterWithFiltering)
ActionDispatch::Journey::Router.send(:prepend, ActionDispatchJourneyRouterWithFiltering)

0 comments on commit a1816d4

Please sign in to comment.