Module: Shared::Notes
- Extended by:
- ActiveSupport::Concern
- Included in:
- AssertedDistribution, Attribution, BiologicalAssociation, BiologicalAssociationsGraph, BiologicalRelationship, CharacterState, Citation, CollectingEvent, CollectionObject, CollectionObjectObservation, CollectionProfile, CommonName, Descriptor, Document, Documentation, FieldOccurrence, GeneAttribute, Georeference, Image, Label, Loan, LoanItem, Observation, ObservationMatrix, ObservationMatrixColumn, ObservationMatrixColumnItem, ObservationMatrixRow, ObservationMatrixRowItem, Organization, Otu, OtuRelationship, Person, Repository, Sequence, SequenceRelationship, Serial, SledImage, 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
#concatenated_notes_string ⇒ Object
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 |
#reject_notes(attributed) ⇒ Object (protected)
22 23 24 |
# File 'app/models/concerns/shared/notes.rb', line 22 def reject_notes(attributed) attributed['text'].blank? end |