Sha256: 2064796ea9c95b5f6de3f93aff7dd762501aa392c764b85100b0495a88da4fd6

Contents?: true

Size: 425 Bytes

Versions: 72

Compression:

Stored size: 425 Bytes

Contents

class MockShardingSessionProxy < Sunspot::SessionProxy::ShardingSessionProxy
  attr_reader :sessions
  alias_method :all_sessions, :sessions

  def initialize(search_session)
    super
    @sessions = Array.new(2) { Sunspot::Session.new }.each_with_index do |session, i|
      session.config.solr.url = "http://localhost:898#{i}/solr"
    end
  end

  def session_for(object)
    @sessions[object.blog_id.to_i % 2]
  end
end

Version data entries

72 entries across 72 versions & 13 rubygems

Version Path
sunspot-2.7.1 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.7.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.6.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.5.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.4.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.3.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.8 spec/mocks/mock_sharding_session_proxy.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.7 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.6 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.5 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.4 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.3 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.2 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.1 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.2.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.1.1 spec/mocks/mock_sharding_session_proxy.rb
sunspot-2.1.0 spec/mocks/mock_sharding_session_proxy.rb
sunspot_suggest-0.0.3 spec/mocks/mock_sharding_session_proxy.rb
sunspot_suggest-0.0.2 spec/mocks/mock_sharding_session_proxy.rb