Sha256: 5345c465fd54c98584d16e62e105fc6d76db2c15bce45f56385316b1e9b3567b
Contents?: true
Size: 479 Bytes
Versions: 25
Compression:
Stored size: 479 Bytes
Contents
module Elastics module RefreshCallbacks def self.included(base) base.class_eval do raise NotImplementedError, "the class #{self} must implement :after_create, :after_update and :after_destroy callbacks" \ unless respond_to?(:after_save) && respond_to?(:after_destroy) refresh = proc{ Elastics.refresh_index :index => self.class.elastics.index } after_save &refresh after_destroy &refresh end end end end
Version data entries
25 entries across 25 versions & 1 rubygems