Sha256: 994de503d81a079b17b1d6867fd8b8f0ae00039e40290b4da64ba46e1bdadb0d
Contents?: true
Size: 626 Bytes
Versions: 15
Compression:
Stored size: 626 Bytes
Contents
module Mobility module Sequel =begin Backend resetter for Sequel models. Triggers backend reset when +refresh+ method is called. =end class BackendResetter < Mobility::BackendResetter # @param [Class] model_class Class of model to which backend resetter will be applied def included(model_class) model_reset_method = @model_reset_method model_class.class_eval do mod = Module.new do define_method :refresh do super().tap { instance_eval(&model_reset_method) } end end include mod end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems