aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-04-22 11:49:27 -0700
committerAndrew White <andyw@pixeltrix.co.uk>2013-04-22 11:49:27 -0700
commit4e21b7b359d7c8d2082b641d56a01e85ce9e9d2e (patch)
treefbf764ede5b5cd50b88ef71032945106ebaed272 /actionpack/lib
parentee0d0eb07d259379d5b426e77afe01d168f353d4 (diff)
parent8d93b5811a310627f9aaf15595dfd48aef19dc34 (diff)
downloadrails-4e21b7b359d7c8d2082b641d56a01e85ce9e9d2e.tar.gz
rails-4e21b7b359d7c8d2082b641d56a01e85ce9e9d2e.tar.bz2
rails-4e21b7b359d7c8d2082b641d56a01e85ce9e9d2e.zip
Merge pull request #10301 from vipulnsward/extract_in_mapper
extract arrays to constants in Mapper
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 80054c8a40..1611812ab4 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -945,6 +945,8 @@ module ActionDispatch
VALID_ON_OPTIONS = [:new, :collection, :member]
RESOURCE_OPTIONS = [:as, :controller, :path, :only, :except, :param, :concerns]
CANONICAL_ACTIONS = %w(index create new show update destroy)
+ RESOURCE_METHOD_SCOPES = [:collection, :member, :new]
+ RESOURCE_SCOPES = [:resource, :resources]
class Resource #:nodoc:
attr_reader :controller, :path, :options, :param
@@ -1499,11 +1501,11 @@ module ActionDispatch
end
def resource_scope? #:nodoc:
- [:resource, :resources].include? @scope[:scope_level]
+ RESOURCE_SCOPES.include? @scope[:scope_level]
end
def resource_method_scope? #:nodoc:
- [:collection, :member, :new].include? @scope[:scope_level]
+ RESOURCE_METHOD_SCOPES.include? @scope[:scope_level]
end
def with_exclusive_scope