Skip to content
Snippets Groups Projects
Unverified Commit 6d29711a authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Merge pull request #789 from noesya/fix_inheritance

Réparation de l'héritage dans les formations
parents e2724371 c609a4b3
No related branches found
No related tags found
No related merge requests found
......@@ -23,12 +23,14 @@ module WithInheritance
def best(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
def best_source(property, is_ancestor: false)
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)
end
end
......@@ -9,6 +9,12 @@ class Static
string
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)
code = ApplicationController.render(
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