Add language settings for users, and translate titles to French
All checks were successful
CI / scan_ruby (push) Successful in 16s
CI / scan_js (push) Successful in 12s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 36s

This commit is contained in:
sto
2025-03-27 12:55:12 +01:00
parent 497768610d
commit 8b0b1c6745
14 changed files with 128 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
# id :integer not null, primary key
# admin :boolean default(FALSE), not null
# email_address :string not null
# lang :string default("en")
# password_digest :string not null
# username :string
# created_at :datetime not null
@@ -22,4 +23,5 @@ class User < ApplicationRecord
normalizes :email_address, with: ->(e) { e.strip.downcase }
validates :username, presence: true, uniqueness: true
validates :lang, inclusion: { in: Languages::AVAILABLE_LANGUAGES.map { |lang| lang[:id] } }
end