Module: CouchPotato::Persistence::Callbacks::ClassMethods

Defined in:
lib/couch_potato/persistence/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after_create(*names) ⇒ Object



94
95
96
97
98
# File 'lib/couch_potato/persistence/callbacks.rb', line 94

def after_create(*names)
  names.each do |name|
    callbacks[:after_create] << name
  end
end

#after_destroy(*names) ⇒ Object



100
101
102
103
104
# File 'lib/couch_potato/persistence/callbacks.rb', line 100

def after_destroy(*names)
  names.each do |name|
    callbacks[:after_destroy] << name
  end
end

#after_save(*names) ⇒ Object



88
89
90
91
92
# File 'lib/couch_potato/persistence/callbacks.rb', line 88

def after_save(*names)
  names.each do |name|
    callbacks[:after_save] << name
  end
end

#after_update(*names) ⇒ Object



82
83
84
85
86
# File 'lib/couch_potato/persistence/callbacks.rb', line 82

def after_update(*names)
  names.each do |name|
    callbacks[:after_update] << name
  end
end

#before_create(*names) ⇒ Object



58
59
60
61
62
# File 'lib/couch_potato/persistence/callbacks.rb', line 58

def before_create(*names)
  names.each do |name|
    callbacks[:before_create] << name
  end
end

#before_destroy(*names) ⇒ Object



76
77
78
79
80
# File 'lib/couch_potato/persistence/callbacks.rb', line 76

def before_destroy(*names)
  names.each do |name|
    callbacks[:before_destroy] << name
  end
end

#before_save(*names) ⇒ Object



64
65
66
67
68
# File 'lib/couch_potato/persistence/callbacks.rb', line 64

def before_save(*names)
  names.each do |name|
    callbacks[:before_save] << name
  end
end

#before_update(*names) ⇒ Object



70
71
72
73
74
# File 'lib/couch_potato/persistence/callbacks.rb', line 70

def before_update(*names)
  names.each do |name|
    callbacks[:before_update] << name
  end
end

#before_validation_on_create(*names) ⇒ Object



40
41
42
43
44
# File 'lib/couch_potato/persistence/callbacks.rb', line 40

def before_validation_on_create(*names)
  names.each do |name|
    callbacks[:before_validation_on_create] << name
  end
end

#before_validation_on_save(*names) ⇒ Object



52
53
54
55
56
# File 'lib/couch_potato/persistence/callbacks.rb', line 52

def before_validation_on_save(*names)
  names.each do |name|
    callbacks[:before_validation_on_save] << name
  end
end

#before_validation_on_update(*names) ⇒ Object



46
47
48
49
50
# File 'lib/couch_potato/persistence/callbacks.rb', line 46

def before_validation_on_update(*names)
  names.each do |name|
    callbacks[:before_validation_on_update] << name
  end
end