Module: Shared::Identifiable

Extended by:
ActiveSupport::Concern
Included in:
CharacterState, CollectingEvent, CollectionObject, CollectionProfile, CommonName, Container, Descriptor, Document, Documentation, Extract, GeneAttribute, Image, Loan, Observation, ObservationMatrix, ObservationMatrixColumnItem, ObservationMatrixRow, ObservationMatrixRowItem, Otu, Person, Sequence, SequenceRelationship, Serial, Source, TaxonName, TypeMaterial, User
Defined in:
app/models/concerns/shared/identifiable.rb

Overview

Shared code for objects that have Identifiers.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) identified?

Returns:

  • (Boolean)


78
79
80
# File 'app/models/concerns/shared/identifiable.rb', line 78

def identified?
  self.identifiers.any?
end

- (Object) reject_identifiers(attributed) (protected)



84
85
86
# File 'app/models/concerns/shared/identifiable.rb', line 84

def reject_identifiers(attributed)
  attributed['identifier'].blank? || attributed['type'].blank?
end