app/models/harvest_event.rb
# NOTE: this logic IS repeated (there is no really elegant way to avoid this),
# so if you change this, change the _ids version!
this logic IS repeated (there is no really elegant way to avoid this),
so if you change this, change the _ids version!
this logic IS repeated ( there is no really elegant way to avoid this ) so if you change this change the _ids version!
def new_data_objects
    @new_data_objects ||= if @new_data_object_ids
      DataObject.where(id: @new_data_object_ids)
    elsif previous_published_harvest
      these_datos = Set.new(data_objects)
      old_datos = Set.new(previous_published_harvest.data_objects)
      ((old_datos - these_datos) +
        data_objects_of_modified_entries).to_a
    else
      data_objects
    end
  end
def new_data_objects @new_data_objects ||= if @new_data_object_ids DataObject . where ( id : @new_data_object_ids ) elsif previous_published_harvest these_datos = Set . new ( data_objects ) old_datos = Set . new ( previous_published_harvest . data_objects ) ( ( old_datos - these_datos ) + data_objects_of_modified_entries ) . to_a else data_objects end end
NOTE: this logic IS repeated (there is no really elegant way to avoid this),
so if you change this, change the _ids version!
NOTE : this logic IS repeated ( there is no really elegant way to avoid this ) so if you change this change the _ids version!
# We already did the hard work, just grab the full objects: