Sha256: 68e1fd7909250b20bdd82989a4b2cfc0daf52412eb94d33717e1077a526ee4b4

Contents?: true

Size: 535 Bytes

Versions: 13

Compression:

Stored size: 535 Bytes

Contents

require File.join(File.dirname(__FILE__), 'post')

module MockAdapter
  class InstanceAdapter < Sunspot::Adapters::InstanceAdapter
    def id
      @instance.id
    end
  end

  class DataAccessor < Sunspot::Adapters::DataAccessor
    def load(id)
      @clazz.get(id.to_i)
    end

    def load_all(ids)
      @clazz.get_all(ids.map { |id| id.to_i })
    end
  end
end

Sunspot::Adapters::DataAccessor.register(MockAdapter::DataAccessor, BaseClass)
Sunspot::Adapters::InstanceAdapter.register(MockAdapter::InstanceAdapter, BaseClass)

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
outoftime-sunspot-0.7.0 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.7.1 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.7.2 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.7.3 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.0 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.1 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.2 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.3 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.4 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.5 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.8 spec/mocks/mock_adapter.rb
outoftime-sunspot-0.8.9 spec/mocks/mock_adapter.rb
pallan-sunspot-0.8.3 spec/mocks/mock_adapter.rb