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:
committed by
Julian Herrero
parent
638c80760f
commit
a68098eaed
@@ -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
|
||||
|
||||
@@ -6,10 +6,6 @@ module Sanitizable
|
||||
before_validation :sanitize_tag_list
|
||||
end
|
||||
|
||||
def description
|
||||
super.try :html_safe
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def sanitize_description
|
||||
|
||||
Reference in New Issue
Block a user