diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-21 15:04:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-18 10:51:10 -0800 |
commit | 648f6113d1f0c6f9cdb2352a24e84c2c204d564b (patch) | |
tree | 12cfbb2356dd4d6a343bfb0afbe6596529864681 | |
parent | 7459ba4f6c7d7b98fc0985255ccfd93186b0950f (diff) | |
download | rails-648f6113d1f0c6f9cdb2352a24e84c2c204d564b.tar.gz rails-648f6113d1f0c6f9cdb2352a24e84c2c204d564b.tar.bz2 rails-648f6113d1f0c6f9cdb2352a24e84c2c204d564b.zip |
move constants to methods since nothing else is using them
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 11 |
1 files 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 ActionDispatch 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 @@ module ActionDispatch end def default_actions - self.class::DEFAULT_ACTIONS + [:index, :create, :new, :show, :update, :destroy, :edit] end def actions @@ -930,16 +928,17 @@ module ActionDispatch 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 |