56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/paranoia.rb', line 56
def self.extended(klazz)
[:restore, :real_destroy].each do |callback_name|
klazz.define_callbacks callback_name
klazz.define_singleton_method("before_#{callback_name}") do |*args, &block|
set_callback(callback_name, :before, *args, &block)
end
klazz.define_singleton_method("around_#{callback_name}") do |*args, &block|
set_callback(callback_name, :around, *args, &block)
end
klazz.define_singleton_method("after_#{callback_name}") do |*args, &block|
set_callback(callback_name, :after, *args, &block)
end
end
end
|