Permalink
Browse files

reduce calls to scope_level

this will help us to encapsulate magical symbols so hopefully we can
eliminate hardcoded magic symbols
  • Loading branch information...
1 parent 047af8d commit 374d66be3e9e994bbe8ad2702ee2209c24b581b0 @tenderlove tenderlove committed Aug 14, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1563,7 +1563,7 @@ def root(path, options={})
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 @@ def nested?
scope_level == :nested
end
+ def resources?
+ scope_level == :resources
+ end
+
def resource_scope?
RESOURCE_SCOPES.include? scope_level
end

0 comments on commit 374d66b

Please sign in to comment.