Skip to content

Instantly share code, notes, and snippets.

@jtushman
Created June 17, 2010 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtushman/442507 to your computer and use it in GitHub Desktop.
Save jtushman/442507 to your computer and use it in GitHub Desktop.
class ActivityMonitor
include Tracking::ActivityMonitor
def initialize
monitor Answer, :only => [:update,:destroy,:create],
:alias => {:create => :answered},
:target => :question
monitor Company
monitor Comment, :only => [:create, :update, :destroy],
:target => :commentable,
:alias => {:create => :commented, :update => "updated comment", :destroy => "deleted comment"}
monitor Intel, :only => [:show,:update,:destroy,:create,:download],
:alias => {:download => :downloaded}
monitor Plant
monitor Question, :only => [:show,:create,:update,:destroy],
:alias => {:create => :asked}
monitor Vote, :only => [:create,:destroy],
:alias => {:create => :voted},
:target => :voteable
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment