-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 6 & Ruby 3 #578
base: master
Are you sure you want to change the base?
Rails 6 & Ruby 3 #578
Conversation
@@ -497,7 +497,7 @@ | |||
end | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
update
to the persistence methods seeing as Rails 6 warns on update_attributes