Skip to content

Commit

Permalink
Refs #36998 - Fix Rails/Pick and Rails/IndexWith cops
Browse files Browse the repository at this point in the history
These did not show up when running Rubocop from the Foreman checkout,
but do when executed directly from a Katello checkout.

(cherry picked from commit 7f99691)
  • Loading branch information
evgeni authored and sbernhard committed Apr 5, 2024
1 parent ae8549b commit 0ac2549
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/mailers/katello/errata_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def promote_errata(options)

def errata_counts(errata)
counts = {:total => errata.count}
counts.merge(Hash[[:security, :bugfix, :enhancement].collect do |errata_type|
[errata_type, errata.send(errata_type).count]
end])
counts.merge([:security, :bugfix, :enhancement].index_with do |errata_type|
errata.send(errata_type).count
end)
end
end
end
2 changes: 1 addition & 1 deletion app/models/katello/concerns/hostgroup_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def inherited_ancestry_attribute(attribute, facet)
facet_model = Facets.registered_facets[facet].hostgroup_configuration.model
value = facet_model.where.not(attribute => nil).joins(:hostgroup).merge(
::Hostgroup.where(id: self.ancestor_ids).reorder(ancestry: :desc)
).limit(1).pluck(attribute).first
).pick(attribute)
end
value
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/katello/concerns/organization_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def redhat_provider
end

def redhat_account_number
pools.upstream.pluck(:account_number).first
pools.upstream.pick(:account_number)
end

def active_pools_count
Expand Down

0 comments on commit 0ac2549

Please sign in to comment.