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

Add User.recently_active scope #29615

Closed
wants to merge 1 commit into from

Conversation

mjankowski
Copy link
Contributor

Changes:

  • In usage outside the User-class (one in feed manager, two in account interactions) merge in the scope instead of repeating the query conditions.
  • In the User class itself -- an existing active scope was also repeating this logic, so replace it with the new scope.
  • While in there, update inactive to match style of new scope since they are opposites

I believe this brings all references to the active duration constant back into User class. Other than changed quoting on the generated queries from the framework, the generated sql for the existing usage is the same.

Possible future thing here -- I did not look at how much usage of the existing active scope there is. The name here is sort of misleading, but something like confirmed_and_recently_active_and_account_not_suspended is excessive. Maybe there's a better alternative.

@mjankowski
Copy link
Contributor Author

Closing in favor of #29775

@mjankowski mjankowski closed this Mar 27, 2024
@mjankowski mjankowski deleted the user-active-duration branch March 27, 2024 13:25
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.

None yet

1 participant