Added helper functions to base journal class
This commit is contained in:
parent
bcbb328cd2
commit
f2957176bf
@ -12,4 +12,12 @@ class Journal < ActiveRecord::Base
|
|||||||
# Do not save an empty journal
|
# Do not save an empty journal
|
||||||
!(details.empty? && notes.blank?)
|
!(details.empty? && notes.blank?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def journalized
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def project
|
||||||
|
journalized.respond_to?('project') ? journalized.project: nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user