Permalink
Browse files

push options inside the scope object

  • Loading branch information...
1 parent dc3f25c commit 20ec0d2aaee0878f819c1d2278e078b1039aee3e @tenderlove tenderlove committed Jul 31, 2014
Showing with 9 additions and 4 deletions.
  1. +9 −4 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 @@ def scope(*args)
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,13 +1891,21 @@ def concerns(*args)
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 = {})
@hash = hash
@parent = parent
end
+ def options
+ OPTIONS
+ end
+
def new(hash)
self.class.new hash, self
end

0 comments on commit 20ec0d2

Please sign in to comment.