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