Conversation
|
|
||
| user = User.using(:brazil).where(:name => 'User1').first | ||
| expect(user.as_json(:except => [:created_at, :updated_at, :id])).to eq('admin' => nil, 'name' => 'User1', 'number' => nil) | ||
| expect(user.as_json(:except => [:created_at, :updated_at, :id, :current_shard])).to eq('admin' => nil, 'name' => 'User1', 'number' => nil) |
There was a problem hiding this comment.
Why is :currend_shard included in the result of using() now? That's what broke a bunch of specs when trying to upgrade our rails 5.2 to rails 6.0 using this branch
|
Is suspect there is also an issue with how rails 6 resets test database that leads to the same/similar issue as described in #361. On rails 5.2 this worked fine but on rails 6 it I get |
|
I've traced this further to load_schema ending up calling establish_master_connection here: https://github.com/rails/rails/blob/v6.0.6.1/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb#L33 which is suppose to connect to the 'postgres' database. Stepping through this it also seems to setup everything as expected but it seems like something ar-octopus is overriding leads to the connection being opend to our test db (as indicated in @SixiS @sosolidkk Can you confirm that for you these things are working? I suspect ar-octopus is assuming a code path that changed in rails 6.0 with it's prelimited multi db support. |
Based off the work by @sosolidkk
#577
Just cleaned it up so it's only the actual code changes to allow it to work in Rails 6 & Ruby 3.
Also
updateto the persistence methods seeing as Rails 6 warns on update_attributes