Follow-up from "Add Sample Data" - Move clear_consumed_relations logic to main consume_relation method
The following discussion from !41699 (merged) should be addressed:
-
@ayufan started a discussion: (+4 comments) This feels like a hacky solution that should rather be implemented as an argument of
consume_relation
:def consume_relation(importable_path, key, mark_as_consumed: true)
And likely rewrite this method a little:
def dates return unless relation_reader.legacy? DATE_MODELS.flatten_map do |model| relation_reader.consume_relation(@importable_path, model, mark_as_consumed: false).map do |model| model.first['due_date'] end end end
This would already return a flattened map of dates.