lib/rbbt/association/item.rb in rbbt-util-5.14.7 vs lib/rbbt/association/item.rb in rbbt-util-5.14.8
- old
+ new
@@ -36,17 +36,18 @@
type = reverse ? knowledge_base.target(database) : knowledge_base.source(database)
knowledge_base.annotate self.source, type #if self.source.any?
end
property :value => :array2single do
- value = knowledge_base.get_index(database).chunked_values_at self
+ value = (reverse ? knowledge_base.get_index(database).reverse : knowledge_base.get_index(database)).chunked_values_at self
value.collect{|v| NamedArray.setup(v, knowledge_base.get_index(database).fields)}
end
property :info => :array2single do
fields = knowledge_base.index_fields(database)
return [{}] * self.length if fields.nil? or fields.empty?
+ value = self.value
value.collect{|v|
Hash[*fields.zip(v).flatten]
}
end