lib/sunspot/instantiated_facet.rb in outoftime-sunspot-0.9.6 vs lib/sunspot/instantiated_facet.rb in outoftime-sunspot-0.9.7

- old
+ new

@@ -13,18 +13,22 @@ # instances for each row, but allows us to still stay lazy and not do work # in the persistent store if the instances are not needed. # def populate_instances! #:nodoc: ids = rows.map { |row| row.value } - reference_class = Sunspot::Util.full_const_get(@field.reference.to_s) + reference_class = Sunspot::Util.full_const_get(@facet_data.reference.to_s) accessor = Adapters::DataAccessor.create(reference_class) instance_map = accessor.load_all(ids).inject({}) do |map, instance| map[Adapters::InstanceAdapter.adapt(instance).id] = instance map end for row in rows row.instance = instance_map[row.value] end + end + + def rows + @facet_data.rows { |value, count| InstantiatedFacetRow.new(value, count, self) } end private #