aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-26 15:02:57 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-26 15:02:57 -0800
commitfea1cdcff4d50d302d8e8532432c3ab107ff816d (patch)
tree3090b2fc1f628ceee8a9866373792a828182fddd /activemodel
parent982091e88a0f550f8be8c6e02ca8a0273b6548da (diff)
downloadrails-fea1cdcff4d50d302d8e8532432c3ab107ff816d.tar.gz
rails-fea1cdcff4d50d302d8e8532432c3ab107ff816d.tar.bz2
rails-fea1cdcff4d50d302d8e8532432c3ab107ff816d.zip
pass the class name to `tableize`
We should not rely on to_s to return the name of the class
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/conversion.rb2
1 files changed, 1 insertions, 1 deletions
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