Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support Rails 4.1.0 #100

Closed
wants to merge 1 commit into from

3 participants

Abdelkader Boudih Adrien cloudride
Abdelkader Boudih

ActionController::Routing is replaced by ActionDispatch::Routing

Abdelkader Boudih seuros Support Rails 4.1.0.beta1
ActionController::Routing is replaced by ActionDispatch::Routing
d4e742f
Adrien
Collaborator

I'll have a look on that soon

Adrien
Collaborator

ActionDispatch::Routing is present since rails 3,so no need for the conditional statement. I've already made the change in the release-4 branch but I've stumbled on other issues with rails 4.1 involving before / after filters.

I'll do some refactoring anyway so this will likely not be an issue.

Abdelkader Boudih

ok

Abdelkader Boudih seuros closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2013
  1. Abdelkader Boudih

    Support Rails 4.1.0.beta1

    seuros authored
    ActionController::Routing is replaced by ActionDispatch::Routing
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 14 deletions.
  1. +18 −14 lib/rails-footnotes/notes/routes_note.rb
32 lib/rails-footnotes/notes/routes_note.rb
View
@@ -15,19 +15,19 @@ def content
end
protected
- def parse_routes
- routes_with_name = Rails.application.routes.named_routes.to_a.flatten
-
- return Rails.application.routes.filtered_routes(:controller => @controller.controller_path).collect do |route|
- # Catch routes name if exists
- i = routes_with_name.index(route)
- name = i ? routes_with_name[i-1].to_s : ''
-
- # Catch segments requirements
- req = route.conditions
- [escape(name), route.conditions.keys.join, route.requirements.reject{|key,value| key == :controller}.inspect, req.inspect]
- end
+ def parse_routes
+ routes_with_name = Rails.application.routes.named_routes.to_a.flatten
+
+ return Rails.application.routes.filtered_routes(:controller => @controller.controller_path).collect do |route|
+ # Catch routes name if exists
+ i = routes_with_name.index(route)
+ name = i ? routes_with_name[i-1].to_s : ''
+
+ # Catch segments requirements
+ req = route.conditions
+ [escape(name), route.conditions.keys.join, route.requirements.reject { |key, value| key == :controller }.inspect, req.inspect]
end
+ end
end
end
@@ -46,7 +46,7 @@ def filtered_routes(filter = {})
return [] unless filter.is_a?(Hash)
return routes.reject do |r|
filter_diff = __hash_diff(filter, r.requirements)
- route_diff = __hash_diff(r.requirements, filter)
+ route_diff = __hash_diff(r.requirements, filter)
(filter_diff == filter) || (filter_diff != route_diff)
end
@@ -56,5 +56,9 @@ def filtered_routes(filter = {})
end
if Footnotes::Notes::RoutesNote.included?
- ActionController::Routing::RouteSet.send :include, Footnotes::Extensions::Routes
+ if Rails::VERSION::MAJOR >= 4
+ ActionDispatch::Routing::RouteSet.send :include, Footnotes::Extensions::Routes
+ else
+ ActionController::Routing::RouteSet.send :include, Footnotes::Extensions::Routes
+ end
end
Something went wrong with that request. Please try again.