Fix user activity indicator to show days remaining until expiry#450
Merged
stefan-burke merged 2 commits intomainfrom Feb 11, 2026
Merged
Fix user activity indicator to show days remaining until expiry#450stefan-burke merged 2 commits intomainfrom
stefan-burke merged 2 commits intomainfrom
Conversation
…d_at The active status on /users was showing days since account creation rather than days remaining until the active_until date expires. Changed the calculation for active users from (Date.current - created_at) to (active_until - Date.current) so it correctly shows remaining days. https://claude.ai/code/session_01GPjKmCuVw2i1mzMee2aMTS
…d_at The active status on /users was showing days since account creation rather than days remaining until the active_until date expires. Changed the calculation for active users from (Date.current - created_at) to (active_until - Date.current) so it correctly shows remaining days. When active_until is nil (always-active accounts), render nothing instead of showing a misleading indicator. https://claude.ai/code/session_01GPjKmCuVw2i1mzMee2aMTS
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.
Summary
Fixed the
user_activity_indicatorhelper method to correctly display the number of days remaining until a user's account expires, rather than days since account creation.Key Changes
(Date.current - user.created_at.to_date)to(user.active_until - Date.current)to show days remaining until expiry instead of account ageactive_untilis nil to prevent errors and render nothing for users without an expiry dateactive_untilrendering empty stringImplementation Details
The helper now properly uses the
active_untilfield to calculate user status, making the indicator more meaningful for tracking subscription or license expiration dates. The method returns an empty safe HTML string when no expiry date is set, allowing it to be safely used in templates without conditional checks.https://claude.ai/code/session_01GPjKmCuVw2i1mzMee2aMTS