##// END OF EJS Templates
Don't require category or target version when they are not available (#20583)....
Don't require category or target version when they are not available (#20583). git-svn-id: http://svn.redmine.org/redmine/trunk@14733 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r13510:d85f73a30d48
r14351:68620da79ab5
Show More
journal_detail.rb
50 lines | 1.3 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 update....
r13490 # Copyright (C) 2006-2015 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
Merged rails-4.1 branch (#14534)....
r13100 attr_protected :id
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
Upgrade to Rails 4.2.0 (#14534)....
r13510 def value=(arg)
write_attribute :value, normalize(arg)
end
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407
Jean-Philippe Lang
Upgrade to Rails 4.2.0 (#14534)....
r13510 def old_value=(arg)
write_attribute :old_value, normalize(arg)
Jean-Philippe Lang
Private issues (#7414)....
r5346 end
Toshi MARUYAMA
remove trailing white-spaces from app/models/journal_detail.rb....
r6407
Jean-Philippe Lang
Upgrade to Rails 4.2.0 (#14534)....
r13510 private
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