From e6e26145a97ad1da7654a9a521f0b9831245b242 Mon Sep 17 00:00:00 2001 From: Stanislav Kolotinskiy Date: Mon, 7 Mar 2022 11:57:08 +0200 Subject: [PATCH] Set empty defaults for insights date format and time format --- lib/travis/api/v3/models/user_preferences.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/travis/api/v3/models/user_preferences.rb b/lib/travis/api/v3/models/user_preferences.rb index 622c47a1d1..ee31bbfe16 100644 --- a/lib/travis/api/v3/models/user_preferences.rb +++ b/lib/travis/api/v3/models/user_preferences.rb @@ -18,10 +18,10 @@ class Models::UserPreferences < Models::JsonSlice attribute :insights_time_zone, String, default: '' - attribute :insights_date_format, String, default: 'DD/MM/YYYY' - validates :insights_date_format, inclusion: { in: %w{DD/MM/YYYY MM/DD/YYYY YYYY/MM/DD}, message: "'%{value}' is not allowed" } + attribute :insights_date_format, String, default: '' + validates :insights_date_format, inclusion: { in: %w{DD/MM/YYYY MM/DD/YYYY YYYY/MM/DD}, message: "'%{value}' is not allowed" }, allow_blank: true - attribute :insights_time_format, String, default: 'HH:mm:ss' - validates :insights_time_format, inclusion: { in: ['h:mm:ss A', 'HH:mm:ss'], message: "'%{value}' is not allowed" } + attribute :insights_time_format, String, default: '' + validates :insights_time_format, inclusion: { in: ['h:mm:ss A', 'HH:mm:ss'], message: "'%{value}' is not allowed" }, allow_blank: true end end