Module: WiserTrails::Common::ClassMethods

Defined in:
lib/wiser_trails/common.rb

Overview

Provides some global methods for every model class.

Instance Method Summary collapse

Instance Method Details

#get_hook(key) ⇒ Object



108
109
110
111
112
113
114
115
# File 'lib/wiser_trails/common.rb', line 108

def get_hook(key)
  key = key.to_sym
  if self.activity_hooks.has_key?(key) and self.activity_hooks[key].is_a? Proc
    self.activity_hooks[key]
  else
    nil
  end
end

#set_wiser_trails_class_defaultsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



98
99
100
101
102
103
104
105
106
# File 'lib/wiser_trails/common.rb', line 98

def set_wiser_trails_class_defaults
  self.activity_owner_global             = nil
  self.           = nil
  self.activity_new_value_global         = {}
  self.activity_hooks                    = {}
  self.activity_custom_fields_global     = {}
  self.activity_skip_fields_global       = {}
  self.activity_force_fields_global      = {}
end