aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-07-30 17:20:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-07-30 17:20:37 -0700
commit20ec0d2aaee0878f819c1d2278e078b1039aee3e (patch)
treed6f800f7cf9c3d6458110cf800542fdeecd5ac79 /actionpack
parentdc3f25c8a5aa64de9225f11498a389a2d31e880a (diff)
downloadrails-20ec0d2aaee0878f819c1d2278e078b1039aee3e.tar.gz
rails-20ec0d2aaee0878f819c1d2278e078b1039aee3e.tar.bz2
rails-20ec0d2aaee0878f819c1d2278e078b1039aee3e.zip
push options inside the scope object
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb13
1 files changed, 9 insertions, 4 deletions
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