From 648f6113d1f0c6f9cdb2352a24e84c2c204d564b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 21 Oct 2011 15:04:48 -0700 Subject: [PATCH] move constants to methods since nothing else is using them --- actionpack/lib/action_dispatch/routing/mapper.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index d196f16600..f49155349c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -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 -- GitLab