diff options
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 209af7a16d..46d83f7fd7 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1563,7 +1563,7 @@ module ActionDispatch raise ArgumentError, "must be called with a path and/or options" end - if @scope.scope_level == :resources + if @scope.resources? with_scope_level(:root) do scope(parent_resource.path) do super(options) @@ -1913,6 +1913,10 @@ module ActionDispatch scope_level == :nested end + def resources? + scope_level == :resources + end + def resource_scope? RESOURCE_SCOPES.include? scope_level end |