Skip to content

Commit 185ca59

Browse files
committed
Fix Rails/FindEach cop
1 parent 6008f20 commit 185ca59

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/controllers/foreman_salt/state_importer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ def remove_from_environment(states, environment)
6363
end
6464

6565
def clean_orphans
66-
SaltModule.all.each do |state|
66+
SaltModule.all.find_each do |state|
6767
state.destroy if state.salt_environments.empty?
6868
end
6969

70-
SaltEnvironment.all.each do |environment|
70+
SaltEnvironment.all.find_each do |environment|
7171
environment.destroy if environment.salt_modules.empty?
7272
end
7373
end

db/migrate/20150220122707_fix_incorrect_report_metrics.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class FixIncorrectReportMetrics < ActiveRecord::Migration[4.2]
22
def up
3-
Report.all.each do |report|
3+
Report.all.find_each do |report|
44
next unless report.metrics && report.metrics['time']
55

66
metrics = report.metrics.dup

db/migrate/20150411003302_add_environments_to_modules.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def up
66
end
77

88
environments = ForemanSalt::SaltEnvironment.all
9-
ForemanSalt::SaltModule.all.each do |state|
9+
ForemanSalt::SaltModule.all.find_each do |state|
1010
state.salt_environments << environments
1111
end
1212
end

0 commit comments

Comments
 (0)