Class: Mobility::ActiveRecord::BackendResetter
- Inherits:
-
Mobility::ActiveModel::BackendResetter
- Object
- Module
- BackendResetter
- Mobility::ActiveModel::BackendResetter
- Mobility::ActiveRecord::BackendResetter
- Defined in:
- lib/mobility/active_record/backend_resetter.rb
Overview
Backend resetter for ActiveRecord models. Adds hook on reload
event to Mobility::ActiveModel::BackendResetter.
Instance Method Summary collapse
Methods inherited from Mobility::ActiveModel::BackendResetter
Methods inherited from BackendResetter
Constructor Details
This class inherits a constructor from Mobility::ActiveModel::BackendResetter
Instance Method Details
#included(model_class) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mobility/active_record/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 :reload do super().tap { instance_eval &model_reset_method } end end include mod end end |