Class: Hyrax::ValkyrieLazyMigration::ResourceName

Inherits:
ResourceName
  • Object
show all
Defined in:
app/models/concerns/hyrax/valkyrie_lazy_migration.rb

Overview

Note:

When we remove Wings, the downstream implementers will need to explicitly craft the properties of the model_name.

Copy over even more of the Wings::ModelRegistery legacy model’s model_name properties

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ResourceName

#human

Constructor Details

#initialize(klass, *args) ⇒ ResourceName

Returns a new instance of ResourceName.



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/models/concerns/hyrax/valkyrie_lazy_migration.rb', line 16

def initialize(klass, *args)
  super

  legacy_model = Wings::ModelRegistry.lookup(klass)
  return unless legacy_model

  instance_variables.each do |ivar|
    next if ivar == :@name
    next if ivar == :@klass
    next if ivar == :@uncountable
    instance_variable_set(ivar, legacy_model.model_name.send(ivar[1..-1]))
  end
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



29
30
31
# File 'app/models/concerns/hyrax/valkyrie_lazy_migration.rb', line 29

def klass
  @klass
end