diff options
author | José Valim <jose.valim@gmail.com> | 2011-07-28 09:56:42 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:21 -0700 |
commit | 91ca214ca0aa431f3cbe90d660c22129b3584bc7 (patch) | |
tree | 81f1b45e069f70fc29243aa600dc8b305c6cd7ce /activemodel/lib/active_model | |
parent | 6e671a8536f17b6f23b5251652015ce8c1557f1f (diff) | |
download | rails-91ca214ca0aa431f3cbe90d660c22129b3584bc7.tar.gz rails-91ca214ca0aa431f3cbe90d660c22129b3584bc7.tar.bz2 rails-91ca214ca0aa431f3cbe90d660c22129b3584bc7.zip |
Rename class method to_path to _to_path and make it explicit that it is an internal method.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/conversion.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index dca1c1aa44..39977f12c3 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -55,11 +55,13 @@ module ActiveModel # Returns a string identifying the path associated with the object. # ActionPack uses this to find a suitable partial to represent the object. def to_path - self.class.to_path + self.class._to_path end - module ClassMethods - def to_path + module ClassMethods #:nodoc: + # Provide a class level cache for the to_path. This is an + # internal method and should not be accessed directly. + def _to_path #:nodoc: @_to_path ||= begin element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self)) collection = ActiveSupport::Inflector.tableize(self) |