Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf authored and tamsin johnson committed Sep 7, 2023
1 parent fdaacfd commit 69ef965
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions app/forms/hyrax/forms/resource_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,17 @@ class << self
def for(resource)
klass = "#{resource.class.name}Form".safe_constantize

if klass
klass.new(resource)
return klass.new(resource) if klass
case resource
when Hyrax::AdministrativeSet
Hyrax::Forms::AdministrativeSetForm.new(resource)
when Hyrax::FileSet
Hyrax::Forms::FileSetForm.new(resource)
when Hyrax::PcdmCollection
Hyrax::Forms::PcdmCollectionForm.new(resource)
else
case resource
when Hyrax::AdministrativeSet
Hyrax::Forms::AdministrativeSetForm.new(resource)
when Hyrax::FileSet
Hyrax::Forms::FileSetForm.new(resource)
when Hyrax::PcdmCollection
Hyrax::Forms::PcdmCollectionForm.new(resource)
else
# NOTE: This will create a +Hyrax::Forms::PcdmObjectForm+.
Hyrax::Forms::ResourceForm(resource.class).new(resource)
end
# NOTE: This will create a +Hyrax::Forms::PcdmObjectForm+.
Hyrax::Forms::ResourceForm(resource.class).new(resource)
end
end

Expand Down

0 comments on commit 69ef965

Please sign in to comment.