Skip to content

Conversation

@elijah-wright
Copy link

@elijah-wright elijah-wright commented Jun 10, 2025

🛠 Summary of changes

this PR changes active_profile in the user model to use find_by, which should be faster. I tested my changes on my machine with a test user with four profiles and the difference was 0.449454 seconds against 0.235338 seconds. it also moves the @active_profile check to where profiles are deactivated by reloading the user model rather than calling .active, which might have been useless (if the code checks a user with a false active_profile and assigned @active_profile based on the in-memory query, @active_profile would become nil and defined?(@active_profile) would be true, but .active would be nil, bypassing the check)

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.

1 participant