Skip to content

Commit

Permalink
Set empty defaults for insights date format and time format
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Kolotinskiy committed Mar 7, 2022
1 parent a1c46ea commit e6e2614
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/travis/api/v3/models/user_preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e6e2614

Please sign in to comment.