Skip to content

Assert lock sql v3.3#3

Open
p8 wants to merge 6 commits into3-2-stablefrom
assert-lock-sql-v3.3
Open

Assert lock sql v3.3#3
p8 wants to merge 6 commits into3-2-stablefrom
assert-lock-sql-v3.3

Conversation

@p8
Copy link
Copy Markdown
Owner

@p8 p8 commented Jun 11, 2021

No description provided.

parndt and others added 3 commits August 28, 2020 11:23
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.
@p8 p8 force-pushed the assert-lock-sql-v3.3 branch 3 times, most recently from 89ef326 to 429697c Compare June 11, 2021 16:21
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
@p8 p8 force-pushed the assert-lock-sql-v3.3 branch 2 times, most recently from 768036a to f4843ce Compare June 11, 2021 18:56
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.
@p8 p8 force-pushed the assert-lock-sql-v3.3 branch from f4843ce to 10e4f1d Compare June 11, 2021 19:28
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.
@p8 p8 force-pushed the assert-lock-sql-v3.3 branch from 10e4f1d to 2bb699b Compare June 11, 2021 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants