Method: ActiveModel::Naming#model_name
- Defined in:
- lib/active_model/naming.rb
#model_name ⇒ Object
Returns an ActiveModel::Name object for module. It can be used to retrieve all kinds of naming-related information.
89 90 91 92 93 94 95 96 |
# File 'lib/active_model/naming.rb', line 89 def model_name @_model_name ||= begin namespace = self.parents.detect do |n| n.respond_to?(:use_relative_model_naming?) && n.use_relative_model_naming? end ActiveModel::Name.new(self, namespace) end end |