Skip to content

Commit

Permalink
only check for the embargo and lease, if they exist on the change_set…
Browse files Browse the repository at this point in the history
… being passed to Hyrax::Transactions::Steps::Save#call
  • Loading branch information
alishaevn committed Jul 31, 2023
1 parent 4b5b054 commit 6314351
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hyrax/transactions/steps/save.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def initialize(persister: Hyrax.persister, publisher: Hyrax.publisher)
# rubocop:disable Metrics/MethodLength
def call(change_set, user: nil)
begin
valid_future_date?(change_set.lease, 'lease_expiration_date') if change_set.lease
valid_future_date?(change_set.embargo, 'embargo_release_date') if change_set.embargo
valid_future_date?(change_set.lease, 'lease_expiration_date') if change_set.respond_to?(:lease) && change_set.lease
valid_future_date?(change_set.embargo, 'embargo_release_date') if change_set.respond_to?(:embargo) && change_set.embargo
new_collections = changed_collection_membership(change_set)
unsaved = change_set.sync
save_leases_and_embargoes(unsaved)
Expand Down

0 comments on commit 6314351

Please sign in to comment.