Skip to content

Instantly share code, notes, and snippets.

@rubypanther
Created February 20, 2012 07:02
Show Gist options
  • Save rubypanther/1868204 to your computer and use it in GitHub Desktop.
Save rubypanther/1868204 to your computer and use it in GitHub Desktop.
def last_activity(date, user_id)
active_id = UserActivity.find(:first, :conditions => ["Date(updated_at) <= ? and user_id = ?", dat
e, user_id], :order => 'updated_at DESC').activity_id
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment