Skip to content
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

rubocop --auto-correct #868

Merged
merged 1 commit into from
Jan 22, 2024
Merged

rubocop --auto-correct #868

merged 1 commit into from
Jan 22, 2024

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Jan 22, 2024

No description provided.

@evgeni
Copy link
Member Author

evgeni commented Jan 22, 2024

no idea why the current CI didn't flag those rubocop offenses, but #866 did, so here we are.

config/routes.rb Outdated Show resolved Hide resolved
@@ -55,8 +55,8 @@ namespace :rh_cloud_inventory do

desc "Synchronize Hosts inventory"
task sync: [:environment, 'dynflow:client'] do
if ! ENV['organization_id'].nil?
organizations = [ Organization.where(:id => ENV['organization_id']).first ]
if !ENV['organization_id'].nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny how the generate_upload is close, but not really the same in various subtle ways.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely can refactor both of them into using a helper method that will receive the action as lambda. Something along the lines of

with_organization_scope do |organization|
  ForemanTasks.async_task(InventorySync::Async::InventoryFullSync, organization)
end

Indeed it would be much prettier.

@evgeni evgeni merged commit a7883a7 into foreman_3_9 Jan 22, 2024
3 checks passed
@evgeni evgeni deleted the rubocop-fixes branch January 22, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants