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

Fix undefined method while getting database configuration #23136

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

agrare
Copy link
Member

@agrare agrare commented Aug 7, 2024

ActiveRecord::Base.configurations no longer responds to [] like a hash.

lib/evm_database.rb:153:in `host': undefined method `[]' lib/evm_database.rb:153:in `host': undefined method `[]'
(ActiveRecord::Base.configurations[ENV['RAILS_ENV']] || {})['host']
                                  ^^^^^^^^^^^^^^^^^^
lib/evm_database.rb:157:in `local?'
lib/workers/evm_server.rb:236:in `configure_server_roles'
lib/workers/evm_server.rb:127:in `start_server'

@agrare agrare added the bug label Aug 7, 2024
@agrare agrare requested a review from Fryguy as a code owner August 7, 2024 14:48
@agrare agrare added the rails7 label Aug 7, 2024
`ActiveRecord::Base.configurations` no longer responds to `[]`
like a hash.

```
lib/evm_database.rb:153:in `host': undefined method `[]' lib/evm_database.rb:153:in `host': undefined method `[]'
(ActiveRecord::Base.configurations[ENV['RAILS_ENV']] || {})['host']
                                  ^^^^^^^^^^^^^^^^^^
lib/evm_database.rb:157:in `local?'
lib/workers/evm_server.rb:236:in `configure_server_roles'
lib/workers/evm_server.rb:127:in `start_server'
```
@agrare agrare force-pushed the fix_evm_database_host_exception branch from 50257a5 to d54aa80 Compare August 7, 2024 14:52
@miq-bot
Copy link
Member

miq-bot commented Aug 7, 2024

Checked commit agrare@d54aa80 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. ⭐

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@jrafanie jrafanie merged commit c1c063b into ManageIQ:master Aug 7, 2024
8 checks passed
@agrare agrare deleted the fix_evm_database_host_exception branch August 7, 2024 15:20
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.

4 participants