diff options
Diffstat (limited to 'activemodel/lib/active_model/naming.rb')
-rw-r--r-- | activemodel/lib/active_model/naming.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index 4c1a82f413..c7b9c41f46 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -21,7 +21,7 @@ module ActiveModel @partial_path = "#{@collection}/#{@element}".freeze @param_key = (namespace ? _singularize(@unnamespaced) : @singular).freeze @route_key = (namespace ? ActiveSupport::Inflector.pluralize(@param_key) : @plural).freeze - @i18n_key = self.underscore.to_sym + @i18n_key = self.underscore.tr('/', '.').to_sym end # Transform the model name into a more humane format, using I18n. By default, @@ -35,8 +35,9 @@ module ActiveModel @klass.respond_to?(:i18n_scope) defaults = @klass.lookup_ancestors.map do |klass| - klass.model_name.i18n_key - end + [klass.model_name.i18n_key, + klass.model_name.i18n_key.to_s.tr('.', '/').to_sym] + end.flatten defaults << options[:default] if options[:default] defaults << @human |