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

[api] Use :allow_nil parameter while retrieving allowed_tags via workflow #13497

Merged

Conversation

AparnaKarve
Copy link
Contributor

Use :allow_nil => true parameter while delegating workflow to the allowed_tags method to avoid the exception below when workflow is nil.

  "error": {
    "kind": "internal_server_error",
    "message": "MiqRequest#v_allowed_tags delegated to workflow.allowed_tags, but workflow is nil:

https://www.pivotaltracker.com/n/projects/1914499/stories/137643447

@AparnaKarve
Copy link
Contributor Author

@abellotti @imtayadeway Please review

@abellotti abellotti self-assigned this Jan 16, 2017
@abellotti abellotti added this to the Sprint 52 Ending Jan 16, 2017 milestone Jan 16, 2017
@abellotti abellotti self-requested a review January 16, 2017 15:06
@abellotti
Copy link
Member

LGTM!!

Copy link
Member

@abellotti abellotti left a comment

Choose a reason for hiding this comment

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

This LGTM!! Thanks.

@@ -39,7 +39,7 @@ class MiqRequest < ApplicationRecord
virtual_column :resource_type, :type => :string
virtual_column :state, :type => :string

delegate :allowed_tags, :to => :workflow, :prefix => :v
delegate :allowed_tags, :to => :workflow, :prefix => :v, :allow_nil => true
Copy link
Member

Choose a reason for hiding this comment

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

👍

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.

2 participants