lib/differential/calculator/group.rb in differential-1.0.5 vs lib/differential/calculator/group.rb in differential-1.0.6

- old
+ new

@@ -43,10 +43,19 @@ upsert_item(record, side) self end + def data_peek(field, side = nil) + first_item&.data_peek(field, side) + end + private + + def first_item + # first() will return an array: [key, value], but we just want the value. + @items_by_id.first&.last + end def upsert_item(record, side) item_id_key = record.id.value item_id = record.id