From f2957176bf4b3eb83b33267a6db8adcad50b37c4 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Tue, 29 Jun 2010 19:39:28 +0200 Subject: [PATCH] Added helper functions to base journal class --- app/models/journal.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/journal.rb b/app/models/journal.rb index d25cc94c..94f66bef 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -12,4 +12,12 @@ class Journal < ActiveRecord::Base # Do not save an empty journal !(details.empty? && notes.blank?) end + + def journalized + nil + end + + def project + journalized.respond_to?('project') ? journalized.project: nil + end end