Skip to content

Commit

Permalink
rails 2.x legacy code is removed from routes note
Browse files Browse the repository at this point in the history
  • Loading branch information
nordringrayhide committed Oct 18, 2013
1 parent c99fd66 commit 33d8b8e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/rails-footnotes/notes/routes_note.rb
Expand Up @@ -24,17 +24,8 @@ def parse_routes
name = i ? routes_with_name[i-1].to_s : ''

# Catch segments requirements
req = {}
if Rails.version < '3.0'
route.segments.each do |segment|
next unless segment.is_a?(ActionController::Routing::DynamicSegment) && segment.regexp
req[segment.key.to_sym] = segment.regexp
end
[escape(name), route.segments.join, route.requirements.reject{|key,value| key == :controller}.inspect, req.inspect]
else
req = route.conditions
[escape(name), route.conditions.keys.join, route.requirements.reject{|key,value| key == :controller}.inspect, req.inspect]
end
req = route.conditions
[escape(name), route.conditions.keys.join, route.requirements.reject{|key,value| key == :controller}.inspect, req.inspect]
end
end
end
Expand Down

0 comments on commit 33d8b8e

Please sign in to comment.