Skip to content
This repository
Browse code

move constants to methods since nothing else is using them

  • Loading branch information...
commit 648f6113d1f0c6f9cdb2352a24e84c2c204d564b 1 parent 7459ba4
Aaron Patterson authored October 21, 2011
11  actionpack/lib/action_dispatch/routing/mapper.rb
@@ -863,8 +863,6 @@ module Resources
863 863
         CANONICAL_ACTIONS = %w(index create new show update destroy)
864 864
 
865 865
         class Resource #:nodoc:
866  
-          DEFAULT_ACTIONS = [:index, :create, :new, :show, :update, :destroy, :edit]
867  
-
868 866
           attr_reader :controller, :path, :options
869 867
 
870 868
           def initialize(entities, options = {})
@@ -876,7 +874,7 @@ def initialize(entities, options = {})
876 874
           end
877 875
 
878 876
           def default_actions
879  
-            self.class::DEFAULT_ACTIONS
  877
+            [:index, :create, :new, :show, :update, :destroy, :edit]
880 878
           end
881 879
 
882 880
           def actions
@@ -930,16 +928,17 @@ def nested_scope
930 928
         end
931 929
 
932 930
         class SingletonResource < Resource #:nodoc:
933  
-          DEFAULT_ACTIONS = [:show, :create, :update, :destroy, :new, :edit]
934  
-
935 931
           def initialize(entities, options)
936 932
             super
937  
-
938 933
             @as         = nil
939 934
             @controller = (options[:controller] || plural).to_s
940 935
             @as         = options[:as]
941 936
           end
942 937
 
  938
+          def default_actions
  939
+            [:show, :create, :update, :destroy, :new, :edit]
  940
+          end
  941
+
943 942
           def plural
944 943
             @plural ||= name.to_s.pluralize
945 944
           end

0 notes on commit 648f611

Please sign in to comment.
Something went wrong with that request. Please try again.