From cdb47434080c3d1c21a688be8db8517c85bd26e4 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 9 Aug 2020 15:57:44 +0000 Subject: [PATCH] use "do end" instead of {} at app/models/query.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19972 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/models/query.rb b/app/models/query.rb index 6da317514..ae852d8fb 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -454,9 +454,13 @@ class Query < ActiveRecord::Base when :date, :date_past case operator_for(field) when "=", ">=", "<=", "><" - add_filter_error(field, :invalid) if values_for(field).detect {|v| - v.present? && (!/\A\d{4}-\d{2}-\d{2}(T\d{2}((:)?\d{2}){0,2}(Z|\d{2}:?\d{2})?)?\z/.match?(v) || parse_date(v).nil?) - } + if values_for(field).detect do |v| + v.present? && + (!/\A\d{4}-\d{2}-\d{2}(T\d{2}((:)?\d{2}){0,2}(Z|\d{2}:?\d{2})?)?\z/.match?(v) || + parse_date(v).nil?) + end + add_filter_error(field, :invalid) + end when ">t-", "t+", "