Module: Shared::Notes

Extended by:
ActiveSupport::Concern
Included in:
AssertedDistribution, BiologicalAssociation, BiologicalRelationship, CharacterState, Citation, CollectingEvent, CollectionObject, CollectionObjectObservation, CollectionProfile, CommonName, Descriptor, Document, Documentation, GeneAttribute, Georeference, Image, Loan, LoanItem, Observation, ObservationMatrix, ObservationMatrixColumn, ObservationMatrixColumnItem, ObservationMatrixRow, ObservationMatrixRowItem, Otu, Person, Repository, Sequence, SequenceRelationship, Serial, Source, SqedDepiction, TaxonDetermination, TaxonName, TaxonNameClassification, TaxonNameRelationship, TypeMaterial, User
Defined in:
app/models/concerns/shared/notes.rb

Overview

Shared code for extending data classes with Notes.

Instance Method Summary (collapse)

Instance Method Details

- (Object) concatenated_notes_string



15
16
17
18
# File 'app/models/concerns/shared/notes.rb', line 15

def concatenated_notes_string
  s = notes.order(updated_at: :desc).collect { |n| n.note_string }.join('||')
  s == '' ? nil : s
end

- (Object) reject_notes(attributed) (protected)



22
23
24
# File 'app/models/concerns/shared/notes.rb', line 22

def reject_notes(attributed)
  attributed['text'].blank?
end