app/repository_models/curation_concern/embargoable.rb in curate-0.1.3 vs app/repository_models/curation_concern/embargoable.rb in curate-0.2.0

- old
+ new

@@ -1,13 +1,24 @@ require File.expand_path('../../../validators/future_date_validator', __FILE__) module CurationConcern module Embargoable + module VisibilityOverride + def set_visibility(value) + if value == AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO + super(AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC) + else + super(value) + end + end + end + include VisibilityOverride extend ActiveSupport::Concern included do validates :embargo_release_date, future_date: true before_save :write_embargo_release_date, prepend: true end + def write_embargo_release_date if defined?(@embargo_release_date) embargoable_persistence_container.embargo_release_date = embargo_release_date end