-
Notifications
You must be signed in to change notification settings - Fork 897
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
Rails 5.0/5.1 Use o.reload.assoc, assoc(true) is gone #18079
Changes from all commits
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
class ServiceTemplateAnsibleTower < ServiceTemplate | ||
include ServiceConfigurationMixin | ||
|
||
before_save :remove_invalid_resource | ||
before_update :remove_invalid_resource | ||
|
||
alias job_template configuration_script | ||
alias job_template= configuration_script= | ||
|
@@ -24,7 +24,7 @@ def self.create_catalog_item(options, _auth_user = nil) | |
|
||
def remove_invalid_resource | ||
# remove the resource from both memory and table | ||
service_resources.to_a.delete_if { |r| r.destroy unless r.resource(true) } | ||
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. @bzwei Can you review this change? I needed to remove the 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. I understand the curious: Do we want to change from 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. yeah, I think this needs to be cleanedup and possibly moved up as you suggested elsewhere. I'm not sure why we need to delete_if on an array we don't retain but that seems besides the point of the PR. I agree, it's needs further refinement. |
||
service_resources.to_a.delete_if { |r| r.destroy unless r.reload.resource.present? } | ||
end | ||
|
||
def create_subtasks(_parent_service_task, _parent_service) | ||
|
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.
+1