Skip to content
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

Refactor dirty tracking conditionals for different versions #5575

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

carlosantoniodasilva
Copy link
Member

We have an number of conditions due to how dirty tracking changed around Rails 5.1, that implement methods using one or another method call. I might need more of this for mongo upgrades based on an initial investigation, plus this makes the code really hard to reason about sometimes with these many conditionals.

While I want to drop support for older versions of Rails soon, this centralization of dirty methods that are used by devise conditionally simplifies the usage considerably across the board, moves the version condition to a single place, and will make it easier to refactor later once we drop older Rails version by simply removing the devise_* versions of the methods, alongside the prefix on the method calls for the most part, since those methods follow the naming of the newer Rails versions.

@carlosantoniodasilva carlosantoniodasilva self-assigned this Mar 23, 2023
We have an number of conditions due to how dirty tracking changed around
Rails 5.1, that implement methods using one or another method call. I
might need more of this for mongo upgrades based on an initial
investigation, plus this makes the code really hard to reason about
sometimes with these many conditionals.

While I want to drop support for older versions of Rails soon, this
centralization of dirty methods that are used by devise conditionally
simplifies the usage considerably across the board, moves the version
condition to a single place, and will make it easier to refactor later
once we drop older Rails version by simply removing the `devise_*`
versions of the methods, alongside the prefix on the method calls for
the most part, since those methods follow the naming of the newer Rails
versions.
@carlosantoniodasilva carlosantoniodasilva marked this pull request as ready for review March 23, 2023 22:11
@carlosantoniodasilva carlosantoniodasilva merged commit 367ea42 into main Mar 23, 2023
@carlosantoniodasilva carlosantoniodasilva deleted the ca-dirty-tracking branch March 23, 2023 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant