0
0
Fork 0

Extract error messages to locale file (#2162)

This commit is contained in:
alpaca-tc 2017-04-20 05:19:32 +09:00 committed by Eugen
parent f06cba3f60
commit 2c0d756ad9
4 changed files with 26 additions and 2 deletions

View file

@ -8,7 +8,7 @@ class Account < ApplicationRecord
# Local users
has_one :user, inverse_of: :account
validates :username, presence: true, format: { with: /\A[a-z0-9_]+\z/i, message: 'only letters, numbers and underscores' }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, if: 'local?'
validates :username, presence: true, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, if: 'local?'
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
# Avatar upload