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 find_collection
    begin
      if params[:collection_id] && params[:collection_id].is_a?(Array)
        @collections = Collection.find(params[:collection_id]) 
        @collection = Collection.find(params[:id])
      else
        @collection = Collection.find(params[:collection_id] || params[:id])
      end
    rescue ActiveRecord::RecordNotFound
      flash[:error] = I18n.t(:collection_not_found_error)
      return redirect_back_or_default
    end
    unless @collection.published? || @collection.resource_preview
      render action: 'unpublished'
      return false
    end
  end
def find_collection begin if params [ :collection_id ] && params [ :collection_id ] . is_a? ( Array ) @collections = Collection . find ( params [ :collection_id ] ) @collection = Collection . find ( params [ :id ] ) else @collection = Collection . find ( params [ :collection_id ] || params [ :id ] ) end rescue ActiveRecord :: RecordNotFound flash [ :error ] = I18n . t ( :collection_not_found_error ) return redirect_back_or_default end unless @collection . published? || @collection . resource_preview render action : 'unpublished' return false end end
TODO - review these.
TODO - review these .
# target collections for move/copy