Skip to content

Commit

Permalink
push options inside the scope object
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jul 31, 2014
1 parent dc3f25c commit 20ec0d2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 20ec0d2

Please sign in to comment.