Skip to content

Commit

Permalink
update configurations to match receiving symbol fix dumperhq#14
Browse files Browse the repository at this point in the history
  • Loading branch information
nanophate committed Jan 2, 2023
1 parent 57d57a8 commit b2e8ffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dumper/database/postgresql.rb
Expand Up @@ -24,7 +24,7 @@ def set_config
return unless defined?(ActiveRecord::Base) &&
ActiveRecord::Base.configurations &&
(config = ActiveRecord::Base.configurations[rails_env]) &&
(config['adapter'] == 'postgresql')
(config[:adapter] == 'postgresql')

@config = {
:host => config['host'],
Expand Down

1 comment on commit b2e8ffe

@nanophate
Copy link
Member Author

Choose a reason for hiding this comment

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

Additional note for comparing the output on the Rails 6.1 for config['adapter'] and config[:adapter]

[5] pry(#<Dumper::Database::PostgreSQL>)> config = ActiveRecord::Base.configurations[rails_env]
=> {:adapter=>"postgresql", :encoding=>"utf8", :pool=>5, :database=>"xxxx_jp_web_development"}
[6] pry(#<Dumper::Database::PostgreSQL>)> config['adapter'] == 'postgresql'
=> false
[7] pry(#<Dumper::Database::PostgreSQL>)> config['adapter']
=> nil
[8] pry(#<Dumper::Database::PostgreSQL>)> config
=> {:adapter=>"postgresql", :encoding=>"utf8", :pool=>5, :database=>"xxxx_jp_web_development"}
[9] pry(#<Dumper::Database::PostgreSQL>)> config[:adapter]
=> "postgresql"
[10] pry(#<Dumper::Database::PostgreSQL>)> config[:adapter] == 'postgresql'
=> true

Please sign in to comment.