app/models/concerns/hydra/access_controls/embargoable.rb in hydra-access-controls-11.0.6 vs app/models/concerns/hydra/access_controls/embargoable.rb in hydra-access-controls-11.0.7

- old
+ new

@@ -3,11 +3,11 @@ module Embargoable extend ActiveSupport::Concern include Hydra::AccessControls::WithAccessRight included do - validates :lease_expiration_date, :'hydra/future_date' => true, if: :enforce_future_date_for_lease? - validates :embargo_release_date, :'hydra/future_date' => true, if: :enforce_future_date_for_embargo? + validates :lease_expiration_date, :'hydra/future_date' => true, if: :enforce_future_date_for_lease?, on: :create + validates :embargo_release_date, :'hydra/future_date' => true, if: :enforce_future_date_for_embargo?, on: :create belongs_to :embargo, predicate: Hydra::ACL.hasEmbargo, class_name: 'Hydra::AccessControls::Embargo', autosave: true belongs_to :lease, predicate: Hydra::ACL.hasLease, class_name: 'Hydra::AccessControls::Lease', autosave: true delegate :visibility_during_embargo, :visibility_during_embargo=, :visibility_after_embargo, :visibility_after_embargo=, :embargo_release_date, :embargo_release_date=, :embargo_history, :embargo_history=, to: :existing_or_new_embargo