提交 648f6113 编写于 作者: A Aaron Patterson

move constants to methods since nothing else is using them

上级 7459ba4f
......@@ -863,8 +863,6 @@ module Resources
CANONICAL_ACTIONS = %w(index create new show update destroy)
class Resource #:nodoc:
DEFAULT_ACTIONS = [:index, :create, :new, :show, :update, :destroy, :edit]
attr_reader :controller, :path, :options
def initialize(entities, options = {})
......@@ -876,7 +874,7 @@ def initialize(entities, options = {})
end
def default_actions
self.class::DEFAULT_ACTIONS
[:index, :create, :new, :show, :update, :destroy, :edit]
end
def actions
......@@ -930,16 +928,17 @@ def nested_scope
end
class SingletonResource < Resource #:nodoc:
DEFAULT_ACTIONS = [:show, :create, :update, :destroy, :new, :edit]
def initialize(entities, options)
super
@as = nil
@controller = (options[:controller] || plural).to_s
@as = options[:as]
end
def default_actions
[:show, :create, :update, :destroy, :new, :edit]
end
def plural
@plural ||= name.to_s.pluralize
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册