Sha256: 58f7c5dc7b444f2a1b861c5222f1ebffa700625c60ba0a8d62e3da775de6732c

Contents?: true

Size: 321 Bytes

Versions: 126

Compression:

Stored size: 321 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

126 entries across 126 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.17 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.16 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.15 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.14 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.13 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.12 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.11 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.7 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.6 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.5 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.10 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.9 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.8 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.7 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.4 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.6 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.3 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.2 lib/ddr/events/reindex_object_after_save.rb
ddr-models-3.0.0.beta.4 lib/ddr/events/reindex_object_after_save.rb
ddr-models-2.4.1 lib/ddr/events/reindex_object_after_save.rb