Skip to content

Commit

Permalink
Fix Rails/FindEach cop
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver authored and ekohl committed Jan 23, 2024
1 parent f10586d commit d4cb570
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/foreman_salt/state_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ def remove_from_environment(states, environment)
end

def clean_orphans
SaltModule.all.each do |state|
SaltModule.all.find_each do |state|
state.destroy if state.salt_environments.empty?
end

SaltEnvironment.all.each do |environment|
SaltEnvironment.all.find_each do |environment|
environment.destroy if environment.salt_modules.empty?
end
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20150220122707_fix_incorrect_report_metrics.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class FixIncorrectReportMetrics < ActiveRecord::Migration[4.2]
def up
Report.all.each do |report|
Report.all.find_each do |report|
next unless report.metrics && report.metrics['time']

metrics = report.metrics.dup
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20150411003302_add_environments_to_modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def up
end

environments = ForemanSalt::SaltEnvironment.all
ForemanSalt::SaltModule.all.each do |state|
ForemanSalt::SaltModule.all.find_each do |state|
state.salt_environments << environments
end
end
Expand Down

0 comments on commit d4cb570

Please sign in to comment.