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

climate

parent a0f3b7b8
No related branches found
No related tags found
No related merge requests found
......@@ -27,16 +27,16 @@ module Backlinkable
def backlinks(kind, website)
backlinks_blocks(website).published.map { |block|
# Correct kind
next unless block.about.is_a?(kind)
# Mentioning self
next unless self.in?(block.template.children)
# About published
next unless block.about.published?
block.about
block.about if backlink_in_block?(block, kind)
}.compact
end
def backlink_in_block?(block, kind)
block.about.is_a?(kind) && # Correct kind
self.in?(block.template.children) && # Mentioning self
block.about.published? # About published
end
def backlinks_blocks(website)
case self.class.to_s
when 'University::Organization'
......
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