Fix sanitization for translatable description attribute

Move method from sanitizable to globalizable concern because
globalize_accessors were overiding sanitizable method and was never
called. Another solution to this could be to load sanitizable
always after globalizable concern.

Old method implementation was not working well with globalize_accessors,
it was returning nil always.
This commit is contained in:
Senén Rodero Rodríguez
2019-01-04 14:03:49 +01:00
committed by Julian Herrero
parent 638c80760f
commit a68098eaed
2 changed files with 4 additions and 4 deletions

View File

@@ -12,6 +12,10 @@ module Globalizable
def assign_model_to_translations
translations.each { |translation| translation.globalized_model = self }
end
def description
self.read_attribute(:description).try :html_safe
end
end
class_methods do