app/controllers/collections_controller.rb
# TODO - review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
# collections
review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
collections
review these . There are too many and as a result there ' s some redundancy in for example checking whether the user is logged in on unpublished collections
def choose_taxa_data
    return must_be_logged_in unless logged_in?
    taxon_items = []
    @collection.collection_items.taxa.each do |taxon_item|
      taxon_items += TaxonPage.new(TaxonConcept.find(taxon_item.collected_item_id)).data.get_data.data_point_uris
    end
    @taxon_collected_items = taxon_items.compact.uniq(&:predicate).paginate(page: params[:page], per_page: RECORDS_PER_PAGE)
    respond_to do |format|
      format.html { render 'choose_taxa_data'}
      format.js { render 'choose_taxa_data' }
    end
  end
def choose_taxa_data return must_be_logged_in unless logged_in? taxon_items = [ ] @collection . collection_items . taxa . each do | taxon_item | taxon_items += TaxonPage . new ( TaxonConcept . find ( taxon_item . collected_item_id ) ) . data . get_data . data_point_uris end @taxon_collected_items = taxon_items . compact . uniq ( & :predicate ) . paginate ( page : params [ :page ] , per_page : RECORDS_PER_PAGE ) respond_to do | format | format . html { render 'choose_taxa_data' } format . js { render 'choose_taxa_data' } end end
TODO - review these.
TODO - review these .