Skip to content

Instantly share code, notes, and snippets.

@milgroma
milgroma / tracking_usage
Created February 3, 2014 15:35
Are people using our tool?
def self.are_you_using_this
## get all of the users
u = User.all
## for each user, do the following thing
u.each do |u|
## get the date of user’s latest session
last_session_date = u.sessions.last ? u.sessions.last.created_at : nil