Class: ReactiveRecord::Base
- Inherits:
-
Object
- Object
- ReactiveRecord::Base
- Defined in:
- lib/reactive_record/base.rb
Class Method Summary collapse
Class Method Details
.when_not_saving(model) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/reactive_record/base.rb', line 5 def self.when_not_saving(model) if @records[model].detect { |record| record.saving? } poller = every (0.1) do unless @records[model].detect { |record| record.saving? } poller.stop yield model end end else yield model end end |