Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wings] Remove convert_class_name_to_valkyrie_resource_class #3931

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/wings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ module Wings; end

ActiveFedora::Base.include Wings::Valkyrizable

Valkyrie.config.resource_class_resolver = lambda do |_klass_name|
Wings::ModelTransformer.convert_class_name_to_valkyrie_resource_class(internal_resource)
end

Valkyrie::MetadataAdapter.register(
Wings::Valkyrie::MetadataAdapter.new, :wings_adapter
)
Expand Down
15 changes: 0 additions & 15 deletions lib/wings/model_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,6 @@ def self.base_for(klass:)
end
end

##
# @note The method signature is to conform to Valkyrie's method signature
# for ::Valkyrie.config.resource_class_resolver
#
# @param class_name [String] a string representation of an `ActiveFedora`
# model
#
# @return [Class] a dynamically generated `Valkyrie::Resource` subclass
# mirroring the provided class name
#
def self.convert_class_name_to_valkyrie_resource_class(class_name)
klass = class_name.constantize
to_valkyrie_resource_class(klass: klass)
end

##
# @param klass [String] an `ActiveFedora` model
#
Expand Down
9 changes: 0 additions & 9 deletions spec/wings/model_transformer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@
end
end

describe '.convert_class_name_to_valkyrie_resource_class' do
context 'when given a ActiveFedora class name (eg. a constant that responds to #properties)' do
it 'creates a Valkyrie::Resource class' do
subject = described_class.convert_class_name_to_valkyrie_resource_class('GenericWork')
expect(subject.new).to be_a Valkyrie::Resource
end
end
end

describe '.to_valkyrie_resource_class' do
context 'when given a ActiveFedora class (eg. a constant that responds to #properties)' do
context 'for the returned object (e.g. a class)' do
Expand Down