summaryrefslogtreecommitdiffstats
path: root/app/models/journal_detail.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-04 15:38:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-04 15:38:52 +0000
commit9adb0c61a903eae9930a84510b25a8ed156ed4f8 (patch)
tree23387cb547c98f57ca28f3f31e473e007300c0f5 /app/models/journal_detail.rb
parent9a66463ff8464e5780923f0f9476524fdbc6d978 (diff)
downloadredmine-9adb0c61a903eae9930a84510b25a8ed156ed4f8.tar.gz
redmine-9adb0c61a903eae9930a84510b25a8ed156ed4f8.zip
Make sure that dates are stored as YYYY-MM-DD in journal details (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11117 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/journal_detail.rb')
-rw-r--r--app/models/journal_detail.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/journal_detail.rb b/app/models/journal_detail.rb
index 2c4b3a0bf..331fb889b 100644
--- a/app/models/journal_detail.rb
+++ b/app/models/journal_detail.rb
@@ -27,10 +27,13 @@ class JournalDetail < ActiveRecord::Base
end
def normalize(v)
- if v == true
+ case v
+ when true
"1"
- elsif v == false
+ when false
"0"
+ when Date
+ v.strftime("%Y-%m-%d")
else
v
end