From cabb1c89d1ad4906d437b1ef000ece68aa6eead3 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 14 May 2018 11:09:23 +0200 Subject: [PATCH] Improved error messages for type attributes. --- app/models/object_manager/attribute.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/object_manager/attribute.rb b/app/models/object_manager/attribute.rb index 745554f45..5ed09f906 100644 --- a/app/models/object_manager/attribute.rb +++ b/app/models/object_manager/attribute.rb @@ -769,8 +769,8 @@ to send no browser reload event, pass false # validate data_option if data_type == 'input' - raise 'Need data_option[:type] param' if !data_option[:type] - raise "Invalid data_option[:type] param '#{data_option[:type]}'" if data_option[:type] !~ /^(text|password|tel|fax|email|url)$/ + raise 'Need data_option[:type] param e. g. (text|password|tel|fax|email|url)' if !data_option[:type] + raise "Invalid data_option[:type] param '#{data_option[:type]}' (text|password|tel|fax|email|url)" if data_option[:type] !~ /^(text|password|tel|fax|email|url)$/ raise 'Need data_option[:maxlength] param' if !data_option[:maxlength] raise "Invalid data_option[:maxlength] param #{data_option[:maxlength]}" if data_option[:maxlength].to_s !~ /^\d+?$/ end