aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-08-01 11:42:00 +0200
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:26 -0700
commitb6b6e81a5c29d4adb3007659ca30e02444ad0c9c (patch)
treee8e2a931f597a2ff64e910d5f924219a952fe0ac /actionpack/lib
parent30ef55de66decbbcf6475917c741c42fb738718b (diff)
downloadrails-b6b6e81a5c29d4adb3007659ca30e02444ad0c9c.tar.gz
rails-b6b6e81a5c29d4adb3007659ca30e02444ad0c9c.tar.bz2
rails-b6b6e81a5c29d4adb3007659ca30e02444ad0c9c.zip
Rename new method to_path to to_partial_path to avoid conflicts with File#to_path and similar.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb8
-rw-r--r--actionpack/lib/action_view/renderer/partial_renderer.rb6
2 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 85dea96bbb..f22c466666 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -1227,12 +1227,12 @@ module ActionView
parent_builder.multipart = multipart if parent_builder
end
- def self._to_path
- @_to_path ||= name.demodulize.underscore.sub!(/_builder$/, '')
+ def self._to_partial_path
+ @_to_partial_path ||= name.demodulize.underscore.sub!(/_builder$/, '')
end
- def to_path
- self.class._to_path
+ def to_partial_path
+ self.class._to_partial_path
end
def to_model
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb
index f67388b8cf..cd0f7054a9 100644
--- a/actionpack/lib/action_view/renderer/partial_renderer.rb
+++ b/actionpack/lib/action_view/renderer/partial_renderer.rb
@@ -364,10 +364,10 @@ module ActionView
def partial_path(object = @object)
object = object.to_model if object.respond_to?(:to_model)
- path = if object.respond_to?(:to_path)
- object.to_path
+ path = if object.respond_to?(:to_partial_path)
+ object.to_partial_path
else
- ActiveSupport::Deprecation.warn "ActiveModel-compatible objects whose classes return a #model_name that responds to #partial_path are deprecated. Please respond to #to_path directly instead."
+ ActiveSupport::Deprecation.warn "ActiveModel-compatible objects whose classes return a #model_name that responds to #partial_path are deprecated. Please respond to #to_partial_path directly instead."
object.class.model_name.partial_path
end