Class: ActiveModelCachers::ActiveRecord::GlobalCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/active_model_cachers/active_record/global_callbacks.rb

Instance Method Summary collapse

Constructor Details

#initializeGlobalCallbacks

Returns a new instance of GlobalCallbacks.



4
5
6
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 4

def initialize
  @type_callbacks = {}
end

Instance Method Details

#after_commit1(class_name = nil, &block) ⇒ Object



24
25
26
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 24

def after_commit1(class_name = nil, &block)
  define_callbacks(:after_commit1, class_name, &block)
end

#after_commit2(class_name = nil, &block) ⇒ Object



28
29
30
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 28

def after_commit2(class_name = nil, &block)
  define_callbacks(:after_commit2, class_name, &block)
end

#after_delete(class_name = nil, &block) ⇒ Object



16
17
18
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 16

def after_delete(class_name = nil, &block)
  define_callbacks(:after_delete, class_name, &block)
end

#after_touch1(class_name = nil, &block) ⇒ Object



32
33
34
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 32

def after_touch1(class_name = nil, &block)
  define_callbacks(:after_touch1, class_name, &block)
end

#after_touch2(class_name = nil, &block) ⇒ Object



36
37
38
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 36

def after_touch2(class_name = nil, &block)
  define_callbacks(:after_touch2, class_name, &block)
end

#before_delete1(class_name = nil, &block) ⇒ Object



8
9
10
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 8

def before_delete1(class_name = nil, &block)
  define_callbacks(:before_delete1, class_name, &block)
end

#before_delete2(class_name = nil, &block) ⇒ Object



12
13
14
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 12

def before_delete2(class_name = nil, &block)
  define_callbacks(:before_delete2, class_name, &block)
end

#on_nullify(class_name = nil, &block) ⇒ Object



20
21
22
# File 'lib/active_model_cachers/active_record/global_callbacks.rb', line 20

def on_nullify(class_name = nil, &block)
  define_callbacks(:on_nullify, class_name, &block)
end