Class: Dor::AdminPolicyObject

Inherits:
Abstract
  • Object
show all
Defined in:
lib/dor/models/admin_policy_object.rb

Direct Known Subclasses

Hydrus::AdminPolicyObject

Instance Method Summary collapse

Methods inherited from Abstract

#adapt_to_cmodel, #add_collection, #allows_modification?, assign_pid, #current_version, #druid_regex, has_object_type, #pid_regex, #read_rights=, #reapply_admin_policy_object_defaults, #remove_collection, #remove_druid_prefix, #to_solr

Instance Method Details

#agreementObject



38
39
40
# File 'lib/dor/models/admin_policy_object.rb', line 38

def agreement
  agreement_object ? agreement_object.pid : ''
end

#agreement=(val) ⇒ Object

Raises:

  • (ArgumentError)


42
43
44
45
46
# File 'lib/dor/models/admin_policy_object.rb', line 42

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