summaryrefslogtreecommitdiffstats
path: root/app/models/journal_detail.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-17 17:02:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-17 17:02:55 +0000
commitd85f73a30d48b3472346fb712106e6d5f4403278 (patch)
tree35d9205b3bf1da3c4e1cc9fc7699f798395d4702 /app/models/journal_detail.rb
parent3ea8b706978b490fc54cde8e14dcde2a748dec1a (diff)
downloadredmine-d85f73a30d48b3472346fb712106e6d5f4403278.tar.gz
redmine-d85f73a30d48b3472346fb712106e6d5f4403278.zip
Upgrade to Rails 4.2.0 (#14534).
git-svn-id: http://svn.redmine.org/redmine/trunk@13892 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/journal_detail.rb')
-rw-r--r--app/models/journal_detail.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/journal_detail.rb b/app/models/journal_detail.rb
index 368d16993..d74dd0955 100644
--- a/app/models/journal_detail.rb
+++ b/app/models/journal_detail.rb
@@ -17,7 +17,6 @@
class JournalDetail < ActiveRecord::Base
belongs_to :journal
- before_save :normalize_values
attr_protected :id
def custom_field
@@ -26,13 +25,16 @@ class JournalDetail < ActiveRecord::Base
end
end
- private
+ def value=(arg)
+ write_attribute :value, normalize(arg)
+ end
- def normalize_values
- self.value = normalize(value)
- self.old_value = normalize(old_value)
+ def old_value=(arg)
+ write_attribute :old_value, normalize(arg)
end
+ private
+
def normalize(v)
case v
when true