Module: Dor::Editable

Extended by:
ActiveSupport::Concern
Included in:
AdminPolicyObject
Defined in:
lib/dor/models/concerns/editable.rb

Overview

This is basically used just by APOs. Arguably “editable” is the wrong name.

Constant Summary collapse

CREATIVE_COMMONS_USE_LICENSES =
ActiveSupport::Deprecation::DeprecatedConstantProxy.new('CREATIVE_COMMONS_USE_LICENSES', 'Dor::CreativeCommonsLicenseService')
OPEN_DATA_COMMONS_USE_LICENSES =
ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OPEN_DATA_COMMONS_USE_LICENSES', 'Dor::OpenDataLicenseService')

Instance Method Summary collapse

Instance Method Details

#agreementObject



32
33
34
# File 'lib/dor/models/concerns/editable.rb', line 32

def agreement
  agreement_object ? agreement_object.pid : ''
end

#agreement=(val) ⇒ Object

Raises:

  • (ArgumentError)


36
37
38
39
40
# File 'lib/dor/models/concerns/editable.rb', line 36

def agreement=(val)
  raise ArgumentError, 'agreement must have a valid druid' if val.blank?

  self.agreement_object = Dor.find val.to_s, cast: true
end