Skip to content

Instantly share code, notes, and snippets.

@labria
Forked from kossnocorp/activity_status.rb
Last active December 22, 2015 15:19
Show Gist options
  • Save labria/6491796 to your computer and use it in GitHub Desktop.
Save labria/6491796 to your computer and use it in GitHub Desktop.
def activity_status
if last_activity_time < Time.now-CURRENTLY_WORKING_DELAY.hour
'working'
elsif last_activity_time > Time.now-INACTIVE_DELAY.hours
'active'
elsif has_activity?
'inactive'
elsif signed_in_at_least_once?
'no_activity'
else
'never_sign_in'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment