Module: Shared::Notable

Extended by:
ActiveSupport::Concern
Included in:
AssertedDistribution, BiologicalAssociation, BiologicalRelationship, Citation, CollectingEvent, CollectionObject, CollectionObjectObservation, CollectionProfile, CommonName, Document, Documentation, Image, Loan, LoanItem, Otu, Person, Repository, Serial, Source, SqedDepiction, TaxonName, TypeMaterial, User
Defined in:
app/models/concerns/shared/notable.rb

Overview

Shared code for extending data classes with Notes.

Instance Method Summary (collapse)

Instance Method Details

- (Object) concatenated_notes_string



13
14
15
16
# File 'app/models/concerns/shared/notable.rb', line 13

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)



20
21
22
# File 'app/models/concerns/shared/notable.rb', line 20

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