提交 8d93b581 编写于 作者: V Vipul A M

extract arrays to constants in Mapper

上级 f95b06f9
......@@ -945,6 +945,8 @@ module Resources
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 @@ def scope_action_options #:nodoc:
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册