Skip to content

Commit

Permalink
Merge pull request #1560 from alphagov/switch-to-using-the-government…
Browse files Browse the repository at this point in the history
…-from-the-links

Switch to using the government from links, rather than the details
  • Loading branch information
Christopher Baines authored Nov 29, 2019
2 parents 0e7b7c9 + 4f06d08 commit 2be5df1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/presenters/content_item/political.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ def political?
end

def historical?
content_item["details"].include?("government") && !content_item["details"]["government"]["current"]
government_current = content_item.dig(
"links", "government", 0, "details", "current"
)

# Treat no government as not historical
return false if government_current.nil?

!government_current
end
end
end

0 comments on commit 2be5df1

Please sign in to comment.