Skip to content

Commit

Permalink
Change lambda to proc
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpierce authored and tamsin johnson committed May 1, 2023
1 parent f2b7b4b commit 29ad74c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/forms/hyrax/forms/work_embargo_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 29ad74c

Please sign in to comment.