-
Notifications
You must be signed in to change notification settings - Fork 369
Some Rubocop fixes #4595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Rubocop fixes #4595
Changes from 4 commits
9270fe9
8388162
9d6e524
3e1ffbc
1f02e20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ def perform | |
| orphaned_delayed_jobs = Delayed::Job. | ||
| where(Sequel.lit("run_at < CURRENT_TIMESTAMP - INTERVAL '?' DAY", force_delete_after)) | ||
|
|
||
| unless orphaned_delayed_jobs.count.zero? | ||
| unless orphaned_delayed_jobs.none? | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be changed to |
||
| logger.info("Deleting #{orphaned_delayed_jobs.count} orphaned Delayed Jobs older than #{force_delete_after} days") | ||
|
|
||
| orphaned_delayed_jobs.delete | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,7 +124,7 @@ def find_routing_guid(domain) | |
| end | ||
|
|
||
| def create_seed_security_groups(config) | ||
| return unless config.get(:security_group_definitions) && SecurityGroup.count == 0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rubocop gave a bad advice here. On a model/dataset we should use The other good function besides |
||
| return unless config.get(:security_group_definitions) && SecurityGroup.none? | ||
|
|
||
| config.get(:security_group_definitions).each do |security_group| | ||
| seed_security_group = security_group.dup | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -542,7 +542,7 @@ module Repositories | |
|
|
||
| started_app_count = ProcessModel.where(state: 'STARTED').count | ||
|
|
||
| expect(AppUsageEvent.count > 1).to be true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| expect(AppUsageEvent.many?).to be true | ||
| expect do | ||
| repository.purge_and_reseed_started_apps! | ||
| end.to change(AppUsageEvent, :count).to(started_app_count) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many?andone?also issue aSELECT * FROM ...- so here count seems to be the better option.