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