diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index 5d28e65ab..56d125d1d 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -9,6 +9,17 @@ class Budget translates :summary, touch: true translates :description, touch: true include Globalizable + + class Translation + before_validation :sanitize_description + + private + + def sanitize_description + self.description = WYSIWYGSanitizer.new.sanitize(description) + end + end + include Sanitizable belongs_to :budget @@ -99,15 +110,5 @@ class Budget def in_phase_or_later?(phase) PHASE_KINDS.index(kind) >= PHASE_KINDS.index(phase) end - - class Translation < Globalize::ActiveRecord::Translation - before_validation :sanitize_description - - private - - def sanitize_description - self.description = WYSIWYGSanitizer.new.sanitize(description) - end - end end end