lib/hydra/pcdm/models/concerns/collection_behavior.rb in hydra-pcdm-0.1.0 vs lib/hydra/pcdm/models/concerns/collection_behavior.rb in hydra-pcdm-0.2.0

- old
+ new

@@ -1,7 +1,6 @@ module Hydra::PCDM - # behavior: # 1) Hydra::PCDM::Collection can aggregate (pcdm:hasMember) Hydra::PCDM::Collection (no infinite loop, e.g., A -> B -> C -> A) # 2) Hydra::PCDM::Collection can aggregate (pcdm:hasMember) Hydra::PCDM::Object # 3) Hydra::PCDM::Collection can aggregate (ore:aggregates) Hydra::PCDM::Object (Object related to the Collection) @@ -13,21 +12,21 @@ # module CollectionBehavior extend ActiveSupport::Concern included do - type RDFVocabularies::PCDMTerms.Collection + type Vocab::PCDMTerms.Collection include ::Hydra::PCDM::PcdmBehavior - filters_association :members, as: :child_collections, condition: :pcdm_collection? + filters_association :members, as: :collections, condition: :pcdm_collection? end module ClassMethods def indexer Hydra::PCDM::CollectionIndexer end - + def type_validator end end def pcdm_object? @@ -35,8 +34,22 @@ end def pcdm_collection? true end + + def child_collections + warn '[DEPRECATION] `child_collections` is deprecated in Hydra::PCDM. Please use `collections` instead. This has a target date for removal of 10-31-2015' + collections + end + + def child_collections=(new_collections) + warn '[DEPRECATION] `child_collections=` is deprecated in Hydra::PCDM. Please use `collections=` instead. This has a target date for removal of 10-31-2015' + self.collections = new_collections + end + + def child_collection_ids + warn '[DEPRECATION] `child_collection_ids` is deprecated in Hydra::PCDM. Please use `collection_ids` instead. This has a target date for removal of 10-31-2015' + collection_ids + end end end -