Sha256: b6a228d0a83f5ebe675d81c3f662c6358afbd7a022628c2434f70768d653e875

Contents?: true

Size: 427 Bytes

Versions: 28

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  ##
  # A factory that builds work forms based on the `#model_name` of the work.
  class WorkFormService
    def self.build(curation_concern, current_ability, *extra)
      form_class(curation_concern).new(curation_concern, current_ability, *extra)
    end

    def self.form_class(curation_concern)
      Hyrax.const_get("#{curation_concern.model_name.name}Form")
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hyrax-5.0.4 app/services/hyrax/work_form_service.rb
hyrax-5.0.3 app/services/hyrax/work_form_service.rb
hyrax-5.0.2 app/services/hyrax/work_form_service.rb
hyrax-5.0.1 app/services/hyrax/work_form_service.rb
hyrax-5.0.0 app/services/hyrax/work_form_service.rb
hyrax-5.0.0.rc3 app/services/hyrax/work_form_service.rb
hyrax-5.0.0.rc2 app/services/hyrax/work_form_service.rb
hyrax-5.0.0.rc1 app/services/hyrax/work_form_service.rb
hyrax-3.6.0 app/services/hyrax/work_form_service.rb
hyrax-4.0.0 app/services/hyrax/work_form_service.rb
hyrax-4.0.0.rc3 app/services/hyrax/work_form_service.rb
hyrax-4.0.0.rc2 app/services/hyrax/work_form_service.rb
hyrax-4.0.0.rc1 app/services/hyrax/work_form_service.rb
hyrax-3.5.0 app/services/hyrax/work_form_service.rb
hyrax-4.0.0.beta2 app/services/hyrax/work_form_service.rb
hyrax-3.4.2 app/services/hyrax/work_form_service.rb
hyrax-4.0.0.beta1 app/services/hyrax/work_form_service.rb
hyrax-3.4.1 app/services/hyrax/work_form_service.rb
hyrax-3.4.0 app/services/hyrax/work_form_service.rb
hyrax-3.3.0 app/services/hyrax/work_form_service.rb