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 load_item
    if params[:item_type] && params[:item_id]
      case params[:item_type]
      when 'DataObject'
        @item = DataObject.find(params[:item_id])
      when 'TaxonConcept'
        @item = TaxonConcept.find(params[:item_id])
      when 'User'
        @item = User.find(params[:item_id])
      when 'Community'
        @item = Community.find(params[:item_id])
      when 'Collection'
        @item = Collection.find(params[:item_id])
      else
        raise EOL::Exceptions::ObjectNotFound
      end
    end
  end
def load_item if params [ :item_type ] && params [ :item_id ] case params [ :item_type ] when 'DataObject' @item = DataObject . find ( params [ :item_id ] ) when 'TaxonConcept' @item = TaxonConcept . find ( params [ :item_id ] ) when 'User' @item = User . find ( params [ :item_id ] ) when 'Community' @item = Community . find ( params [ :item_id ] ) when 'Collection' @item = Collection . find ( params [ :item_id ] ) else raise EOL :: Exceptions :: ObjectNotFound end end end
TODO - review these.
TODO - review these .