module SafeCallbacks
Constants
- CALLBACK_METHODS
Public Class Methods
extend_mongo_mapper!()
click to toggle source
# File lib/safe_callbacks.rb, line 17 def extend_mongo_mapper! MongoMapper::Document.extend SafeCallbacks::MongoMapperExtension end
extended(mod)
click to toggle source
# File lib/safe_callbacks.rb, line 21 def extended(mod) SafeCallbacks::CALLBACK_METHODS.each do |callback_method_name| unsafe_callback_method_name = :"unsafe_#{callback_method_name}" if mod.respond_to?(callback_method_name) && !mod.respond_to?(unsafe_callback_method_name) (class << mod; self; end).instance_eval do alias_method unsafe_callback_method_name, callback_method_name end end end mod.extend ClassMethods end
included(mod)
click to toggle source
# File lib/safe_callbacks.rb, line 35 def included(mod) mod.extend self end