Class: Heart::Annotation

Inherits:
Application
  • Object
show all
Defined in:
app/models/heart/annotation.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.visible(args) ⇒ Object



10
11
12
13
14
15
16
# File 'app/models/heart/annotation.rb', line 10

def self.visible(args)
  from = args[:from].to_date
  to = args[:to].to_date
  dashboard_id = args[:dashboard_id]
  annotations = []
  annotations.push(Annotation.where(:fulldate => from..to).where(:dashboard_id => [nil, dashboard_id]).order("fulldate ASC").all)
end

Instance Method Details

#validate_noteObject



6
7
8
# File 'app/models/heart/annotation.rb', line 6

def validate_note
  self.note = self.note.to_s.gsub("\n\r","<br />").gsub("\r", "").gsub("\n", "<br />")
end