Assert lock sql v3.3#3
Open
p8 wants to merge 6 commits into3-2-stablefrom
Open
Conversation
Fixes collectiveidea#422 Rails 6.1 deprecations of the form: > DEPRECATION WARNING: Class level methods will no longer inherit scoping from `###` in Rails 6.1. To continue using the scoped relation, pass it into the block directly. To instead access the full set of models, as Rails 6.1 will, use `Model.unscoped`, or `Model.default_scoped` if a model has default scopes.
89ef326 to
429697c
Compare
Tests Against Ruby Versions: - 2.6 - 2.7 Tests Against Rails Version: - 5.0 - 5.1 - 5.2 - 6.0 Tests Against DB Types: - Postgress - MySQL - SqLite
768036a to
f4843ce
Compare
To run the specs against a different CI we need to set the DB environment variable. We also have to make sure the credentials match the db/database.yml The database configuration requires stringified keys for Rails 6.1. The branch for the latest Rails version has been changed from master to main.
To fix Rails 6.1 deprecations, some changes were made to scopes in 6c5040c and 247716b. Testing if the correct rows are locked for updates can be difficult, as these scopes are only used in the internals. We can make sure the generated sql is correct by. The assert_sql implementation has been copied from Rails: https://github.com/rails/rails/blob/f5abd30f0d1f5916935d1781549ab23273e3963a/activerecord/test/cases/test_case.rb These specs have been tested first against 3-2-stable to make sure there are no regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.