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

Add UUID to insights facets that are missing it #571

Merged
merged 2 commits into from Jun 28, 2021

Conversation

ShimShtein
Copy link
Member

No description provided.

Copy link
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

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

One suggestion, but it might be down to personal taste. Otherwise looks good

Comment on lines 31 to 34
missing_uuids = existing_facets.select { |host_id, uuid| uuid.empty? }.map(&:first)

missing_uuids.each do |host_id|
InsightsFacet.where(host_id: host_id).update_all(uuid: uuids_hash[host_id])
Copy link
Contributor

Choose a reason for hiding this comment

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

How about something like this this?

Suggested change
missing_uuids = existing_facets.select { |host_id, uuid| uuid.empty? }.map(&:first)
missing_uuids.each do |host_id|
InsightsFacet.where(host_id: host_id).update_all(uuid: uuids_hash[host_id])
missing_uuids = existing_facets.select { |host_id, uuid| uuid.empty? }.each do |host_id, uuid|
InsightsFacet.where(host_id: host_id).update_all(uuid: uuid)

@ShimShtein
Copy link
Member Author

@adamruzicka Done!

Copy link
Member

@Ron-Lavi Ron-Lavi left a comment

Choose a reason for hiding this comment

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

Thanks @ShimShtein !

@Ron-Lavi Ron-Lavi merged commit 71f5707 into theforeman:master Jun 28, 2021
ShimShtein added a commit to ShimShtein/foreman_rh_cloud that referenced this pull request Jun 28, 2021
* Add UUID to insights facets that are missing it

* Review fixes
Ron-Lavi pushed a commit that referenced this pull request Jun 29, 2021
* Add UUID to insights facets that are missing it

* Review fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants