Class: Hyrax::ValkyrieLazyMigration::ResourceName
- Inherits:
-
ResourceName
- Object
- ActiveModel::Name
- Name
- ResourceName
- Hyrax::ValkyrieLazyMigration::ResourceName
- 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
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(klass, *args) ⇒ ResourceName
constructor
A new instance of ResourceName.
Methods inherited from ResourceName
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
#klass ⇒ Object (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 |