Use Translation classes consistently
We're moving the code for the phases translation class to the same place in the code the other translation classes are: right after including the Globalizable module.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user