Module: Shared::Notes

Overview

Shared code for extending data classes with Notes.

Instance Method Summary collapse

Instance Method Details

#concatenated_notes_stringObject


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