app/forms/hyrax/forms/file_manager_form.rb in hyrax-3.0.0.pre.rc3 vs app/forms/hyrax/forms/file_manager_form.rb in hyrax-3.0.0.pre.rc4

- old
+ new

@@ -4,14 +4,21 @@ class FileManagerForm include HydraEditor::Form self.terms = [] delegate :id, :thumbnail_id, :representative_id, :to_s, to: :model attr_reader :current_ability, :request - def initialize(work, ability) + + ## + # @param work [Object] a work with members + # @param ability [::Ability] the current ability + # @param member_factory [Class] the member_presenter factory object to use + # when constructing presenters + def initialize(work, ability, member_factory: MemberPresenterFactory) super(work) @current_ability = ability @request = nil + @member_factory = member_factory end def version model.etag end @@ -19,10 +26,10 @@ delegate :member_presenters, to: :member_presenter_factory private def member_presenter_factory - MemberPresenterFactory.new(model, current_ability) + @member_factory.new(model, current_ability) end end end end