Module: ViewTrail::ClassMethods

Defined in:
lib/view_trail.rb

Instance Method Summary collapse

Instance Method Details

#has_view_trail(*conditions) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/view_trail.rb', line 29

def has_view_trail(*conditions)
  before_filter :set_whodiddit
  after_filter(:record_activity, conditions)
  cattr_accessor :view_trail_active
  self.view_trail_active = true
  send :include, InstanceMethods
end

#view_trail_offObject



37
38
39
# File 'lib/view_trail.rb', line 37

def view_trail_off
  self.view_trail_active = false
end

#view_trail_onObject



40
41
42
# File 'lib/view_trail.rb', line 40

def view_trail_on
  self.view_trail_active = true
end