From fea1cdcff4d50d302d8e8532432c3ab107ff816d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 26 Feb 2014 15:02:57 -0800 Subject: pass the class name to `tableize` We should not rely on to_s to return the name of the class --- activemodel/lib/active_model/conversion.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel') diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index 0a19ef686d..06fe0720ef 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -84,7 +84,7 @@ module ActiveModel def _to_partial_path #:nodoc: @_to_partial_path ||= begin element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self)) - collection = ActiveSupport::Inflector.tableize(self) + collection = ActiveSupport::Inflector.tableize(name) "#{collection}/#{element}".freeze end end -- cgit v1.2.3