Module: Hyrax::Naming::ClassMethods

Defined in:
app/models/concerns/hyrax/naming.rb

Instance Method Summary collapse

Instance Method Details

#model_nameObject

Override of ActiveModel::Model name that allows us to use our custom name class



8
9
10
11
12
13
14
15
# File 'app/models/concerns/hyrax/naming.rb', line 8

def model_name
  @_model_name ||= begin
    namespace = parents.detect do |n|
      n.respond_to?(:use_relative_model_naming?) && n.use_relative_model_naming?
    end
    Hyrax::Name.new(self, namespace)
  end
end