Sha256: f5576f71f591188f411fa27a65481859c0c79d52bb44a28ab8932d9cc4a2d2b1

Contents?: true

Size: 330 Bytes

Versions: 27

Compression:

Stored size: 330 Bytes

Contents

module Ddr
  module Events
    module ReindexObjectAfterSave
      extend ActiveSupport::Concern

      included do
        after_save :reindex_object, unless: "object.nil?" # in case saved with validate: false
      end
    
      protected
      
      def reindex_object
        object.update_index
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ddr-models-1.13.2 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.13.1 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.13.0 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.8 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.12.3 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.7 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.12.2 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.6 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.12.1 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.5 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.12.0 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.4 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.3 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.2 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.1 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.11.0 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.10.0 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.9.0 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.8.1 lib/ddr/events/reindex_object_after_save.rb
ddr-models-1.8.0 lib/ddr/events/reindex_object_after_save.rb