From 20ec0d2aaee0878f819c1d2278e078b1039aee3e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 30 Jul 2014 17:20:37 -0700 Subject: push options inside the scope object --- actionpack/lib/action_dispatch/routing/mapper.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 1ffe16999d..6f7e6f3128 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -13,9 +13,6 @@ module ActionDispatch module Routing class Mapper URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port] - SCOPE_OPTIONS = [:path, :shallow_path, :as, :shallow_prefix, :module, - :controller, :action, :path_names, :constraints, - :shallow, :blocks, :defaults, :options] class Constraints < Endpoint #:nodoc: attr_reader :app, :constraints @@ -791,7 +788,7 @@ module ActionDispatch block, options[:constraints] = options[:constraints], {} end - SCOPE_OPTIONS.each do |option| + @scope.options.each do |option| if option == :blocks value = block elsif option == :options @@ -1894,6 +1891,10 @@ module ActionDispatch end class Scope # :nodoc: + OPTIONS = [:path, :shallow_path, :as, :shallow_prefix, :module, + :controller, :action, :path_names, :constraints, + :shallow, :blocks, :defaults, :options] + attr_reader :parent def initialize(hash, parent = {}) @@ -1901,6 +1902,10 @@ module ActionDispatch @parent = parent end + def options + OPTIONS + end + def new(hash) self.class.new hash, self end -- cgit v1.2.3