-
Notifications
You must be signed in to change notification settings - Fork 898
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
Generalize targeted inventory collection saving #15198
Generalize targeted inventory collection saving #15198
Conversation
Generalize targeted saving using the InventoryCollection
Base IC configurations for a CloudManager targeted refresh
Base IC configurations for a CloudManager targeted refresh
Fix rubocop issue with map(&:foreign_key)
@miq-bot add_label enhancement |
Autofix rubocop issues
@@ -92,14 +93,22 @@ def hardwares(extra_attributes = {}) | |||
relation | |||
end | |||
|
|||
attributes[:targeted_arel] = lambda do |inventory_collection| | |||
manager_uuids = inventory_collection.parent_inventory_collections.collect(&:manager_uuids).map(&:to_a).flatten |
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.
Prefer .flat_map over .collect.map.flatten
manager_uuids = inventory_collection.parent_inventory_collections.flat_map { |c| c.manager_uuids.to_a }
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.
👍
Check for targeted? when scanning targeted dependencies
Use flat_map instead of collect&map&flattten
Checked commits Ladas/manageiq@b4bb3fb~...0d0f45d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/manager_refresh/inventory_collection.rb
app/models/manager_refresh/inventory_collection_default/cloud_manager.rb
|
Generalize targeted inventory collection saving