Fix Style/NumericPredicate rubocop warnings

This commit is contained in:
Tom Hughes 2018-09-22 17:34:58 +01:00
parent 64146b4f36
commit de29e9b3f5
14 changed files with 21 additions and 42 deletions

View file

@ -582,7 +582,7 @@ class ChangesetController < ApplicationController
# Get the maximum number of comments to return
def comments_limit
if params[:limit]
if params[:limit].to_i > 0 && params[:limit].to_i <= 10000
if params[:limit].to_i.positive? && params[:limit].to_i <= 10000
params[:limit].to_i
else
raise OSM::APIBadUserInput, "Comments limit must be between 1 and 10000"