Skip to content

Commit 67f1232

Browse files
committed
rubocop
1 parent 0c2f369 commit 67f1232

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

app/helpers/results_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ def article?(format)
8686
# @param result [Hash] A normalized Primo result hash
8787
# @return [Boolean] True if the result has links, availability, or ThirdIron/OpenAlex triggers
8888
def result_get?(result)
89-
has_renderable_links?(result) ||
89+
renderable_links?(result) ||
9090
result[:availability].present? ||
9191
(Feature.enabled?(:oa_always) && article?(result[:format])) ||
92-
has_thirdiron_content?(result)
92+
thirdiron_content?(result)
9393
end
9494

9595
private
9696

97-
def has_renderable_links?(result)
97+
def renderable_links?(result)
9898
return false unless result[:links].present?
9999
return true if Feature.enabled?(:record_link)
100100

101101
# If record_link is disabled, exclude results that have ONLY "full record" links
102102
result[:links].any? { |link| link['kind'].downcase != 'full record' }
103103
end
104104

105-
def has_thirdiron_content?(result)
105+
def thirdiron_content?(result)
106106
ThirdIron.enabled? && (
107107
result[:doi].present? ||
108108
result[:pmid].present? ||

test/helpers/results_helper_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ class ResultsHelperTest < ActionView::TestCase
184184
test 'result_get? returns true when result has both full record and PDF links even if record_link feature is disabled' do
185185
ClimateControl.modify(FEATURE_RECORD_LINK: nil, THIRDIRON_ID: nil, THIRDIRON_KEY: nil, FEATURE_OA_ALWAYS: nil) do
186186
assert result_get?({
187-
links: [
188-
{ 'kind' => 'Full Record', 'url' => 'https://example.com' },
189-
{ 'kind' => 'PDF', 'url' => 'https://pdf.example.com' }
190-
]
191-
})
187+
links: [
188+
{ 'kind' => 'Full Record', 'url' => 'https://example.com' },
189+
{ 'kind' => 'PDF', 'url' => 'https://pdf.example.com' }
190+
]
191+
})
192192
end
193193
end
194194
end

0 commit comments

Comments
 (0)