From 29ad74cc793323af74b233e07a8c3a693c99774d Mon Sep 17 00:00:00 2001 From: Daniel Pierce Date: Mon, 1 May 2023 15:00:15 -0400 Subject: [PATCH] Change lambda to proc --- app/forms/hyrax/forms/work_embargo_form.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/forms/hyrax/forms/work_embargo_form.rb b/app/forms/hyrax/forms/work_embargo_form.rb index 8a4a2a3d6e..4af56c021e 100644 --- a/app/forms/hyrax/forms/work_embargo_form.rb +++ b/app/forms/hyrax/forms/work_embargo_form.rb @@ -11,9 +11,9 @@ module Forms # +EmbargoesControllerBehavior+. class WorkEmbargoForm < Hyrax::ChangeSet property :embargo, form: Hyrax::Forms::Embargo, populator: :embargo_populator, prepopulator: :embargo_populator - property :embargo_release_date, virtual: true, prepopulator: ->(_opts) { self.embargo_release_date = model.embargo&.embargo_release_date } - property :visibility_after_embargo, virtual: true, prepopulator: ->(_opts) { self.visibility_after_embargo = model.embargo&.visibility_after_embargo } - property :visibility_during_embargo, virtual: true, prepopulator: ->(_opts) { self.visibility_during_embargo = model.embargo&.visibility_during_embargo } + property :embargo_release_date, virtual: true, prepopulator: proc { |_opts| self.embargo_release_date = model.embargo&.embargo_release_date } + property :visibility_after_embargo, virtual: true, prepopulator: proc { |_opts| self.visibility_after_embargo = model.embargo&.visibility_after_embargo } + property :visibility_during_embargo, virtual: true, prepopulator: proc { |_opts| self.visibility_during_embargo = model.embargo&.visibility_during_embargo } def embargo_populator(**) self.embargo = Hyrax::EmbargoManager.embargo_for(resource: model)