app/models/harvest_event.rb
# NOTE: this assumes flattened_ancestors has been updated for this Hierarchy!
this assumes flattened_ancestors has been updated for this Hierarchy!
this assumes flattened_ancestors has been updated for this Hierarchy!
def hierarchy_entry_ids_with_ancestors
    return @hierarchy_entry_ids_with_ancestors if
      @hierarchy_entry_ids_with_ancestors
    harvested = hierarchy_entries.pluck(:id)
    ancestors = FlatEntry.where(hierarchy_entry_id: harvested).
      pluck("DISTINCT ancestor_id")
    @hierarchy_entry_ids_with_ancestors = Set.new(harvested + ancestors).to_a
  end
def hierarchy_entry_ids_with_ancestors return @hierarchy_entry_ids_with_ancestors if @hierarchy_entry_ids_with_ancestors harvested = hierarchy_entries . pluck ( :id ) ancestors = FlatEntry . where ( hierarchy_entry_id : harvested ) . pluck ( "DISTINCT ancestor_id" ) @hierarchy_entry_ids_with_ancestors = Set . new ( harvested + ancestors ) . to_a end
NOTE: this assumes flattened_ancestors has been updated for this Hierarchy!
NOTE : this assumes flattened_ancestors has been updated for this Hierarchy!