diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-30 11:46:54 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-03 11:33:52 -0700 |
commit | c94504cf88b674d23ce472e97f7a3f21a3b43c12 (patch) | |
tree | 46cdab45ea8dc93de673ac5dedc9ce246e5aa7b4 /actionpack/lib/action_dispatch/routing | |
parent | 82f115758e754cac78f753428085c76c04628bb4 (diff) | |
download | rails-c94504cf88b674d23ce472e97f7a3f21a3b43c12.tar.gz rails-c94504cf88b674d23ce472e97f7a3f21a3b43c12.tar.bz2 rails-c94504cf88b674d23ce472e97f7a3f21a3b43c12.zip |
remove :defaults from the IGNORE_OPTIONS list
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 1a9c843175..f1f4e389d6 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -60,7 +60,7 @@ module ActionDispatch end class Mapping #:nodoc: - IGNORE_OPTIONS = [:defaults, :only, :except, :shallow, :shallow_path, :shallow_prefix] + IGNORE_OPTIONS = [:only, :except, :shallow, :shallow_path, :shallow_prefix] ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z} attr_reader :scope, :options, :requirements, :conditions, :defaults @@ -70,6 +70,9 @@ module ActionDispatch @scope = scope @requirements, @conditions, @defaults = {}, {}, {} + @defaults.merge!(scope[:defaults]) if scope[:defaults] + @defaults.merge!(options.delete(:defaults)) if options[:defaults] + options = scope[:options].merge(options) if scope[:options] @to = options.delete :to @default_controller = options[:controller] || scope[:controller] @@ -170,9 +173,6 @@ module ActionDispatch end def normalize_defaults!(formatted, options_constraints) - @defaults.merge!(scope[:defaults]) if scope[:defaults] - @defaults.merge!(options[:defaults]) if options[:defaults] - options.each do |key, default| unless Regexp === default || IGNORE_OPTIONS.include?(key) @defaults[key] = default |