Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
for version rubocop-govuk-4.13.0
  • Loading branch information
Alex Avlonitis committed Jan 12, 2024
1 parent 32307ac commit 062ed52
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/indexer/bulk_payload_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def index_action(doc_hash)
{
"index" => {
"_type" => "generic-document",
"_id" => (doc_hash["_id"] || doc_hash["link"]),
"_id" => doc_hash["_id"] || doc_hash["link"],
},
}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/parameter_parser/aggregate_parameter_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def order
ALLOWED_AGGREGATE_SORT_OPTIONS.include?(option)
end

invalid_orders.each do |option, _|
invalid_orders.each do |(option, _)|
@errors << %("#{option}" is not a valid sort option#{aggregate_description})
end

Expand Down
2 changes: 1 addition & 1 deletion lib/parameter_parser/aggregates_parameter_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(params, allowed_return_fields)
end

def call
@params.each do |key, _values|
@params.each_key do |key|
# to ensure backwards compatibility we will support both facet_* and aggregate_* style naming
# - all aggregations in the request must use the same naming format
matches = key.match(/\A(facet|aggregate)_(.*)\Z/)
Expand Down
2 changes: 1 addition & 1 deletion lib/schema/index_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def es_mappings
properties = {
"document_type" => @document_type_field,
}
@elasticsearch_types.each do |_key, value|
@elasticsearch_types.each_value do |value|
properties = properties.merge(value.es_config)
end
{
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/result_set_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def search_presenter(options)
end

it "have only the fields returned from search engine" do
@output[:results].zip(sample_docs).each do |result, _doc|
@output[:results].zip(sample_docs).each do |(result, _)|
doc_fields = result.keys - %i[_type _id]
returned_fields = result.keys - %i[esscore _type _id]
expect(doc_fields).to eq(returned_fields)
Expand Down Expand Up @@ -198,7 +198,7 @@ def search_presenter(options)
end

it "have only the fields returned from search engine" do
@output[:results].zip(sample_docs).each do |result, _doc|
@output[:results].zip(sample_docs).each do |(result, _)|
doc_fields = result.keys - %i[_type _id]
returned_fields = result.keys - %i[esscore _type _id]
expect(doc_fields).to eq(returned_fields)
Expand Down

0 comments on commit 062ed52

Please sign in to comment.