Module: Shared::Notes
- Extended by:
- ActiveSupport::Concern
- Included in:
- Attribution, BiologicalAssociation, BiologicalAssociationsGraph, BiologicalRelationship, CharacterState, CollectionObjectObservation, CollectionProfile, CommonName, Descriptor, Document, GeneAttribute, Label, Observation, ObservationMatrixColumn, ObservationMatrixColumnItem, Organization, OtuRelationship, Repository, Sequence, SequenceRelationship, Serial, SledImage, TaxonDetermination, 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 |