lib/sunspot/mongoid.rb in sunspot_mongoid-0.4.0 vs lib/sunspot/mongoid.rb in sunspot_mongoid-0.4.1
- old
+ new
@@ -30,14 +30,15 @@
end
end
class DataAccessor < Sunspot::Adapters::DataAccessor
def load(id)
- @clazz.find(id) rescue nil
+ @clazz.find(BSON::ObjectID.from_string(id)) rescue nil
end
def load_all(ids)
- @clazz.where(:_id.in => ids.map { |id| BSON::ObjectID.from_string(id) })
+ @clazz.where(:_id.in => ids.map { |id| BSON::ObjectId.from_string(id) })
end
+
end
end
end