diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-26 15:02:57 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-26 15:02:57 -0800 |
commit | fea1cdcff4d50d302d8e8532432c3ab107ff816d (patch) | |
tree | 3090b2fc1f628ceee8a9866373792a828182fddd /activemodel/lib | |
parent | 982091e88a0f550f8be8c6e02ca8a0273b6548da (diff) | |
download | rails-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/lib')
-rw-r--r-- | activemodel/lib/active_model/conversion.rb | 2 |
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 |