Sha256: 077aae4b986d0fdf05e5ce8f435cf15c55dd7198d5d821ebae0340ea541eb187

Contents?: true

Size: 297 Bytes

Versions: 6

Compression:

Stored size: 297 Bytes

Contents

module Mongoid
  module TirePlugin
    extend ActiveSupport::Concern
    included do
      after_save :tire_reindex
      after_destroy :tire_remove
    end

    private
    def tire_reindex
      SearchIndex.index(self)
    end
    def tire_remove
      SearchIndex.remove(self)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grape-gen-0.0.6 template/lib/mongoid/tire_plugin.rb
grape-gen-0.0.5 template/lib/mongoid/tire_plugin.rb
grape-gen-0.0.4 template/lib/mongoid/tire_plugin.rb
grape-gen-0.0.3 template/lib/mongoid/tire_plugin.rb
grape-gen-0.0.2 template/lib/mongoid/tire_plugin.rb
grape-gen-0.0.1 template/lib/mongoid/tire_plugin.rb