##// END OF EJS Templates
Adds some links for wiki history navigation....
Adds some links for wiki history navigation. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12221 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r11987:7bea176cdb74
r11991:699317e12e7f
Show More
journal_detail.rb
47 lines | 1.2 KiB | text/x-ruby | RubyLexer
/ app / models / journal_detail.rb
Jean-Philippe Lang
Keep track of issue description changes (#746)....
r4834 # Redmine - project management software
Jean-Philippe Lang
Copyright for 2013 (#12788)....
r10939 # Copyright (C) 2006-2013 Jean-Philippe Lang
Jean-Philippe Lang
improved issues change history...
r52 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407 #
Jean-Philippe Lang
improved issues change history...
r52 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407 #
Jean-Philippe Lang
improved issues change history...
r52 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class JournalDetail < ActiveRecord::Base
belongs_to :journal
Jean-Philippe Lang
Private issues (#7414)....
r5346 before_save :normalize_values
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407
Jean-Philippe Lang
Avoid lots of CustomField.find_by_id calls when displaying an issue history with custom fields (#15072)....
r11987 def custom_field
if property == 'cf'
@custom_field ||= CustomField.find_by_id(prop_key)
end
end
Jean-Philippe Lang
Private issues (#7414)....
r5346 private
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407
Jean-Philippe Lang
Private issues (#7414)....
r5346 def normalize_values
self.value = normalize(value)
self.old_value = normalize(old_value)
end
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407
Jean-Philippe Lang
Private issues (#7414)....
r5346 def normalize(v)
Jean-Philippe Lang
Make sure that dates are stored as YYYY-MM-DD in journal details (#12713)....
r10887 case v
when true
Jean-Philippe Lang
Private issues (#7414)....
r5346 "1"
Jean-Philippe Lang
Make sure that dates are stored as YYYY-MM-DD in journal details (#12713)....
r10887 when false
Jean-Philippe Lang
Private issues (#7414)....
r5346 "0"
Jean-Philippe Lang
Make sure that dates are stored as YYYY-MM-DD in journal details (#12713)....
r10887 when Date
v.strftime("%Y-%m-%d")
Jean-Philippe Lang
Private issues (#7414)....
r5346 else
v
end
end
Jean-Philippe Lang
improved issues change history...
r52 end