Don't require database connection when processing attributes
Closed this issue · 0 comments
mrexox commented
Tell us about your environment
Ruby Version:
2.6.3
Rails Version:
6.1.7.3
PostgreSQL Version:
12
Store Attribute Version:
1.1.0
What did you do?
Call bundle exec rails db:prepare
What did you expect to happen?
Database created and seeded.
What actually happened?
Error:
$ rails db:prepare RAILS_ENV=test --trace
** Invoke db:prepare (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
rails aborted!
Caused by:
PG::ConnectionBad: connection to server at "postgres" (172.21.0.3), port 5432 failed: FATAL: database "<changed>" does not exist
/usr/local/bundle/gems/pg-1.2.3/lib/pg.rb:58:in `initialize'
/usr/local/bundle/gems/pg-1.2.3/lib/pg.rb:58:in `new'
/usr/local/bundle/gems/pg-1.2.3/lib/pg.rb:58:in `connect'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/connection_handling.rb:283:in `connection'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/type.rb:51:in `adapter_name_from'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/type.rb:56:in `current_adapter_name'
/usr/local/bundle/gems/activerecord-6.1.7.3/lib/active_record/type.rb:41:in `lookup'
/usr/local/bundle/gems/store_attribute-1.1.0/lib/store_attribute/active_record/store.rb:162:in `_lookup_type'
/usr/local/bundle/gems/store_attribute-1.1.0/lib/store_attribute/active_record/store.rb:157:in `_store_local_stored_attribute'
/usr/local/bundle/gems/store_attribute-1.1.0/lib/store_attribute/active_record/store.rb:142:in `store_attribute'
/app/app/models/user.rb:43:in `<class:User>'
/app/app/models/user.rb:1:in `<main>'