Sha256: 106627e75925420bcc92041ca9251c8575c02ce3183c36cf46888331437849dc
Contents?: true
Size: 580 Bytes
Versions: 17
Compression:
Stored size: 580 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 mod = Module.new do define_method :refresh do super().tap { instance_eval(&model_reset_method) } end end model_class.include mod end end end end
Version data entries
17 entries across 17 versions & 1 rubygems