Skip to content

Commit 5669147

Browse files
committed
rubocop -A
1 parent eb23992 commit 5669147

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

app/controllers/concerns/paginable.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ def stringify_nonpagination_query_params
214214
def stringify_query_params(page: 1, search: @args[:search],
215215
sort_field: @args[:sort_field],
216216
sort_direction: nil)
217-
218217
query_string = { page: page }
219218
query_string['search'] = search if search.present?
220219
if sort_field.present?

app/models/template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def deep_copy(attributes: {}, **options)
284284
copy = dup
285285
if attributes.respond_to?(:each_pair)
286286
attributes.each_pair do |attribute, value|
287-
copy.send(:"#{attribute}=".to_sym, value) if copy.respond_to?(:"#{attribute}=".to_sym)
287+
copy.send(:"#{attribute}=", value) if copy.respond_to?(:"#{attribute}=")
288288
end
289289
end
290290
copy.save! if options.fetch(:save, false)

app/services/external_apis/base_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def handle_http_failure(method:, http_response:)
6565

6666
# Logs the results of a failed HTTP response
6767
def handle_uri_failure(method:, uri:)
68-
msg = "received an invalid uri: '#{uri&.to_s}'!"
68+
msg = "received an invalid uri: '#{uri}'!"
6969
log_error(method: method, error: ExternalApiError.new(msg))
7070
end
7171

app/services/org_selection/hash_to_org_service.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@ def to_org(hash:, allow_create: true)
4040
allow_create ? initialize_org(hash: hash) : nil
4141
end
4242

43-
# rubocop:disable Metrics/AbcSize
4443
def to_identifiers(hash:)
4544
return [] unless hash.present?
4645

4746
out = []
4847
# Process each of the identifiers
4948
hash = hash.with_indifferent_access
50-
idents = hash.select { |k, _v| identifier_keys.include?(k) }
49+
idents = hash.slice(*identifier_keys)
5150
idents.each do |key, value|
52-
attrs = hash.select { |k, _v| attr_keys(hash: hash).include?(k) }
51+
attrs = hash.slice(*attr_keys(hash: hash))
5352
attrs = {} unless attrs.present?
5453
out << Identifier.new(
5554
identifier_scheme_id: IdentifierScheme.by_name(key).first&.id,
@@ -59,7 +58,6 @@ def to_identifiers(hash:)
5958
end
6059
out
6160
end
62-
# rubocop:enable Metrics/AbcSize
6361

6462
private
6563

@@ -71,7 +69,7 @@ def lookup_org_by_id(hash:)
7169

7270
# Lookup the Org by its :identifiers and return if the name matches the search
7371
def lookup_org_by_identifiers(hash:)
74-
identifiers = hash.select { |k, _v| identifier_keys.include?(k) }
72+
identifiers = hash.slice(*identifier_keys)
7573
ids = identifiers.map { |k, v| { name: k, value: v } }
7674
org = Org.from_identifiers(array: ids) if ids.any?
7775
exact_match?(rec: org, name2: hash[:name]) ? org : nil

lib/tasks/data_cleanup.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ namespace :data_cleanup do
178178
# rubocop:disable Metrics/AbcSize
179179
def check_uniqueness(klass, filter)
180180
instance = klass.new
181-
group = [filter.attributes.map { |a| instance.respond_to?(:"#{a}_id") ? :"#{a}_id".to_sym : a }]
181+
group = [filter.attributes.map { |a| instance.respond_to?(:"#{a}_id") ? :"#{a}_id" : a }]
182182

183183
group << filter.options[:scope] if filter.options[:scope].present?
184184
group = group.flatten.uniq

0 commit comments

Comments
 (0)