Sha256: 49fe5698452683af4333089f8d0e62c96efeeb9e61c76c28ca0ab04d37d6d31e

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::Distributed::Index <
  Riddle::Configuration::DistributedIndex

  attr_reader :reference, :options

  def initialize(reference)
    @reference = reference
    @options   = {}

    super reference.to_s.gsub('/', '_')
  end

  def delta?
    false
  end

  def distributed?
    true
  end

  def model
    @model ||= reference.to_s.camelize.constantize
  end

  def primary_key
    @primary_key ||= configuration.settings['primary_key'] || :id
  end

  private

  def configuration
    ThinkingSphinx::Configuration.instance
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinking-sphinx-4.2.0 lib/thinking_sphinx/distributed/index.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/distributed/index.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/distributed/index.rb