Class: Mobility::Sequel::BackendResetter
- Inherits:
-
BackendResetter
- Object
- Module
- BackendResetter
- Mobility::Sequel::BackendResetter
- Defined in:
- lib/mobility/sequel/backend_resetter.rb
Overview
Backend resetter for Sequel models. Triggers backend reset when refresh
method is called.
Instance Method Summary collapse
Methods inherited from BackendResetter
Constructor Details
This class inherits a constructor from Mobility::BackendResetter
Instance Method Details
#included(model_class) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mobility/sequel/backend_resetter.rb', line 12 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 |