Permalink
Browse files

partially expand the parameters to `match`

  • Loading branch information...
1 parent ad1a891 commit ea7ef9597edf9b0579b6c91290348956a705e6b4 @tenderlove tenderlove committed Sep 12, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1465,9 +1465,9 @@ def name_for_action(as, action) #:nodoc:
end
module Shorthand #:nodoc:
- def match(*args)
- if args.size == 1 && args.last.is_a?(Hash)
- options = args.pop
+ def match(path, *rest)
+ if rest.empty? && Hash === path
+ options = path
path, to = options.find { |name, value| name.is_a?(String) }
options.merge!(:to => to).delete(path)
super(path, options)

0 comments on commit ea7ef95

Please sign in to comment.