Sha256: e0d0c091190a99336e94429ca8543d0222d4aae8398d5c7bfdd7a82efe96a9a3

Contents?: true

Size: 532 Bytes

Versions: 7

Compression:

Stored size: 532 Bytes

Contents

module Elastics
  module ModelIndexer

    def self.included(base)
      base.class_eval do
        @elastics ||= ClassProxy::Base.new(base)
        @elastics.extend(ClassProxy::ModelSyncer)
        @elastics.extend(ClassProxy::ModelIndexer).init
        def self.elastics; @elastics end
      end
    end

    def elastics
      @elastics ||= InstanceProxy::ModelIndexer.new(self)
    end

    def elastics_source
      attributes.reject {|k| k.to_s =~ /^_*id$/}
    end

    def elastics_indexable?
      true
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
elastics-models-1.0.10 lib/elastics/model_indexer.rb
elastics-models-1.0.9 lib/elastics/model_indexer.rb
elastics-models-1.0.8 lib/elastics/model_indexer.rb
elastics-models-1.0.7 lib/elastics/model_indexer.rb
elastics-models-1.0.6 lib/elastics/model_indexer.rb
elastics-models-1.0.5 lib/elastics/model_indexer.rb
elastics-models-1.0.4 lib/elastics/model_indexer.rb