Skip to content
Snippets Groups Projects
Commit c609a4b3 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Fix #788

parent 8698c1c6
No related branches found
No related tags found
No related merge requests found
...@@ -23,12 +23,14 @@ module WithInheritance ...@@ -23,12 +23,14 @@ module WithInheritance
def best(property) def best(property)
value = send(property) value = send(property)
value.blank? ? parent&.send("best_#{property}") : value text = Static.html_to_text value.to_html
text.blank? ? parent&.send("best_#{property}") : value
end end
def best_source(property, is_ancestor: false) def best_source(property, is_ancestor: false)
value = send(property) value = send(property)
return (is_ancestor ? self : nil) if value.present? text = Static.html_to_text value.to_html
return (is_ancestor ? self : nil) if text.present?
parent&.send(:best_source, property, is_ancestor: true) parent&.send(:best_source, property, is_ancestor: true)
end end
end end
...@@ -9,6 +9,12 @@ class Static ...@@ -9,6 +9,12 @@ class Static
string string
end end
def self.html_to_text(string)
string = ActionController::Base.helpers.strip_tags string
string = string.strip
string
end
def self.render(template_static, about, website) def self.render(template_static, about, website)
code = ApplicationController.render( code = ApplicationController.render(
template: template_static, template: template_static,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment