Module: ActsAsAppstatsable::InstanceMethods
- Defined in:
- lib/appstats/acts_as_appstatsable.rb
Instance Method Summary collapse
- #track(action, contexts) ⇒ Object
- #track_create ⇒ Object
- #track_destroy ⇒ Object
- #track_update ⇒ Object
Instance Method Details
#track(action, contexts) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/appstats/acts_as_appstatsable.rb', line 59 def track(action,contexts) begin Appstats::Logger.entry(action,contexts) true rescue Exception => e Appstats::Logger.exception_entry(e,:on => action) false end end |
#track_create ⇒ Object
44 45 46 47 |
# File 'lib/appstats/acts_as_appstatsable.rb', line 44 def track_create return false unless self.appstats_after_create track('object-created', :class_name => self.class.name, :class_id => self.id, :details => self.to_s) end |
#track_destroy ⇒ Object
49 50 51 52 |
# File 'lib/appstats/acts_as_appstatsable.rb', line 49 def track_destroy return false unless self.appstats_after_destroy track('object-destroyed', :class_name => self.class.name, :class_id => self.id, :details => self.to_s) end |
#track_update ⇒ Object
54 55 56 57 |
# File 'lib/appstats/acts_as_appstatsable.rb', line 54 def track_update return false unless self.appstats_after_update track('object-updated', :class_name => self.class.name, :class_id => self.id, :details => self.to_s) end |