summaryrefslogtreecommitdiffstats
path: root/app/models/journal_detail.rb
diff options
context:
space:
mode:
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