Refactor time related fields in user preferences into a new class
After https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28339 gets merged, we're going to be storing 5 time-related fields inside the
UserPreference
table.
Some of these fields don't have any validation at all, i.e. the timezone
can be manipulated when the request is sent to the ProfilesController
what may
end with an invalid value in the database.
We're also storing time-related methods to the UserPreference
class and over time this may grow.
I think we can move timezone
, timezone_name
, first_day_of_the_week
, time_display_relative
, and time_format_in_24h to a new class and table, i.e.
UserTimePreference`. There, we can add validations and all specific logic related to the user's time.
/cc @lmcandrew