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

move constants to methods since nothing else is using them

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