Skip to content

Commit

Permalink
Fix rubocop violations
Browse files Browse the repository at this point in the history
  • Loading branch information
tijmenb committed Apr 24, 2018
1 parent bcd0722 commit c3854a0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/govuk_publishing_components/presenters/meta_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def add_taxonomy_tags(meta_tags)
themes = root_taxon_slugs(content_item)
meta_tags["govuk:themes"] = themes.to_a.sort.join(', ') unless themes.empty?

if content_item[:document_type] == 'taxon'
taxons = [content_item]
else
taxons = links[:taxons] || []
end
taxons = if content_item[:document_type] == 'taxon'
[content_item]
else
links[:taxons] || []
end

taxons.sort_by! { |taxon| taxon[:title] }
taxon_slugs_without_theme = taxons.map do |taxon|
Expand Down Expand Up @@ -133,10 +133,7 @@ def should_strip_postcode_pii?(content_item, local_assigns)
# document_type
return local_assigns[:strip_postcode_pii] if local_assigns.key?(:strip_postcode_pii)

formats_that_might_include_postcodes = [
'smart_answer',
'search'
]
formats_that_might_include_postcodes = %w[smart_answer search]
formats_that_might_include_postcodes.include?(content_item[:document_type])
end
end
Expand Down

0 comments on commit c3854a0

Please sign in to comment.