Class: Renalware::Problems::Problem
Class Method Summary
collapse
Instance Method Summary
collapse
#first_or_create_by!, #save_by, #save_by!, #update_by
Class Method Details
.archived ⇒ Object
32
33
34
|
# File 'app/models/renalware/problems/problem.rb', line 32
def self.archived
only_deleted.with_notes
end
|
.current ⇒ Object
28
29
30
|
# File 'app/models/renalware/problems/problem.rb', line 28
def self.current
all.with_notes
end
|
.reject_if_proc ⇒ Object
56
57
58
|
# File 'app/models/renalware/problems/problem.rb', line 56
def self.reject_if_proc
proc { |attrs| attrs[:description].blank? }
end
|
.with_archived ⇒ Object
24
25
26
|
# File 'app/models/renalware/problems/problem.rb', line 24
def self.with_archived
with_deleted
end
|
Instance Method Details
#archived? ⇒ Boolean
36
37
38
|
# File 'app/models/renalware/problems/problem.rb', line 36
def archived?
deleted?
end
|
#archived_at ⇒ Object
40
41
42
|
# File 'app/models/renalware/problems/problem.rb', line 40
def archived_at
deleted_at
end
|
#archived_on ⇒ Object
44
45
46
|
# File 'app/models/renalware/problems/problem.rb', line 44
def archived_on
deleted_at.to_date
end
|
#created_on ⇒ Object
48
49
50
|
# File 'app/models/renalware/problems/problem.rb', line 48
def created_on
created_at.to_date
end
|
64
65
66
|
# File 'app/models/renalware/problems/problem.rb', line 64
def formatted
"#{full_description}, #{date}"
end
|
#full_description ⇒ Object
60
61
62
|
# File 'app/models/renalware/problems/problem.rb', line 60
def full_description
description
end
|
#updated_on ⇒ Object
52
53
54
|
# File 'app/models/renalware/problems/problem.rb', line 52
def updated_on
updated_at.to_date
end
|