From 30186c3f928d280e4af97a4989d7a82dfe68d592 Mon Sep 17 00:00:00 2001 From: radhika Date: Fri, 30 Jun 2017 11:05:00 -0400 Subject: [PATCH] 11870: minor updates Arvados-DCO-1.1-Signed-off-by: Radhika Chippada --- apps/workbench/app/controllers/repositories_controller.rb | 4 ++-- apps/workbench/app/views/repositories/_show_help.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/workbench/app/controllers/repositories_controller.rb b/apps/workbench/app/controllers/repositories_controller.rb index 78ac055a8e..37bc000c75 100644 --- a/apps/workbench/app/controllers/repositories_controller.rb +++ b/apps/workbench/app/controllers/repositories_controller.rb @@ -34,8 +34,8 @@ class RepositoriesController < ApplicationController end def all_repos - limit = if params[:limit] then params[:limit].to_i else 100 end - offset = if params[:offset] then params[:offset].to_i else 0 end + limit = params[:limit].andand.to_i || 100 + offset = params[:offset].andand.to_i || 0 @filters = params[:filters] || [] if @filters.any? diff --git a/apps/workbench/app/views/repositories/_show_help.html.erb b/apps/workbench/app/views/repositories/_show_help.html.erb index 0983d87385..afc7e5484f 100644 --- a/apps/workbench/app/views/repositories/_show_help.html.erb +++ b/apps/workbench/app/views/repositories/_show_help.html.erb @@ -1,7 +1,7 @@ <% filters = @filters + [["owner_uuid", "=", current_user.uuid]] - example = Repository.all.order("name ASC").limit(1).filter(filters).results.first - example = Repository.all.order("name ASC").limit(1).results.first if !example + example = Repository.all.order("name ASC").filter(filters).limit(1).results.first + example = Repository.all.order("name ASC").results.limit(1).first if !example %> <% if example %> -- 2.30.2