app/models/harvest_event.rb
# TODO: The "Right Thing To Do" is to actually store a list of all entry ids
# affected by the harvest (which you would have to do during the harvest). We
# can't affect that yet, sooo...
The "Right Thing To Do" is to actually store a list of all entry ids
affected by the harvest (which you would have to do during the harvest). We
can't affect that yet, sooo
The " Right Thing To Do " is to actually store a list of all entry ids affected by the harvest ( which you would have to do during the harvest ) . We can ' t affect that yet sooo
def new_hierarchy_entry_ids
    @new_hierarchy_entry_ids ||= if previous_published_harvest
      these_leaf_node_ids = Set.new(hierarchy_entries.pluck(:id))
      raise "No entries!" if these_leaf_node_ids.empty?
      new_ancestor_ids = Set.new(HierarchyEntry.
        where(hierarchy_id: hierarchy.id).
        where(["id > ?",
          previous_published_harvest.hierarchy_entries.maximum(:id)]).
        pluck(:id))
      (new_ancestor_ids + these_leaf_node_ids).to_a
    else
      hierarchy_entry_ids_with_ancestors
    end
  end
def new_hierarchy_entry_ids @new_hierarchy_entry_ids ||= if previous_published_harvest these_leaf_node_ids = Set . new ( hierarchy_entries . pluck ( :id ) ) raise "No entries!" if these_leaf_node_ids . empty? new_ancestor_ids = Set . new ( HierarchyEntry . where ( hierarchy_id : hierarchy . id ) . where ( [ "id > ?" , previous_published_harvest . hierarchy_entries . maximum ( :id ) ] ) . pluck ( :id ) ) ( new_ancestor_ids + these_leaf_node_ids ) . to_a else hierarchy_entry_ids_with_ancestors end end
TODO: The "Right Thing To Do" is to actually store a list of all entry ids
affected by the harvest (which you would have to do during the harvest).
TODO : The " Right Thing To Do " is to actually store a list of all entry ids affected by the harvest ( which you would have to do during the harvest ) .
# We are not currently listing ancestor entries in # harvest_events_hierarchy_entries (though perhaps we should). ...So this # query looks for the last entry_id from the last harvest, and grabs all # ids that are higher than that from THIS harvest.