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

find_by 'type' is a string, not a class #130

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Oct 5, 2018

Fixes a rather non-obvious error on Rails 5.1:

  TypeError:
    can't cast Class

@@ -152,14 +152,14 @@ def assert_credentials
expect(expected_configuration_script.authentications.count).to eq(3)

# vault_credential
vault_credential = Authentication.all.find_by(:type => manager_class::VaultCredential, :manager_ref => '1022')
vault_credential = Authentication.all.find_by(:type => manager_class::VaultCredential.name, :manager_ref => '1022')
Copy link
Member

Choose a reason for hiding this comment

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

Why the .all.find_by?

Copy link
Member Author

Choose a reason for hiding this comment

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

wow. 😖 . I'll fix that too

Fixes a rather non-obvious error on Rails 5.1:
  TypeError:
    can't cast Class
@miq-bot
Copy link
Member

miq-bot commented Oct 5, 2018

Checked commit jrafanie@ea3ed40 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍰

@agrare agrare self-assigned this Oct 5, 2018
@agrare agrare merged commit 3c967f5 into ManageIQ:master Oct 5, 2018
@agrare agrare added this to the Sprint 96 Ending Oct 8, 2018 milestone Oct 5, 2018
@jrafanie jrafanie deleted the find_by_type_is_a_string branch October 10, 2018 17:58
@jrafanie
Copy link
Member Author

This was extracted from ManageIQ/manageiq#18076

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.

4 participants