Skip to content

Commit

Permalink
Fix undefined method while getting database configuration
Browse files Browse the repository at this point in the history
`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'
```
  • Loading branch information
agrare committed Aug 7, 2024
1 parent 2e03593 commit d54aa80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/evm_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def self.seed_classes(classes)
private_class_method :seed_classes

def self.host
(ActiveRecord::Base.configurations[ENV['RAILS_ENV']] || {})['host']
ActiveRecord::Base.configurations.find_db_config(Rails.env).host
end

def self.local?
Expand Down

0 comments on commit d54aa80

Please sign in to comment.