I fixed an issue on my rails project locally (with postgres config) while adding in database.yml this statement:
test:
prepared_statements: false
Recently it seems that Heroku has disabled setting DATABASE_URL using heroku config:set DATABASE_URL=
, giving us back an error " ▸ Cannot overwrite attachment values DATABASE_URL."
In order to resolve this, we added an disabled_prepared_statements.rb initializer in config/ containing:
ActiveRecord::Base.configurations[Rails.env].merge!(prepared_statements: false)