diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-16 11:18:09 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-16 11:18:09 +0100 |
commit | a9db42a956fb045131b06ba434a74189c96ad651 (patch) | |
tree | cac55724892f21ec5c10713c874b824dab5ae923 /app/models | |
parent | 5c99e304e5d3e9f975d19d7097bfde3ace986ad8 (diff) |
Validations for local profiles
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 7577d7bd8..b3917e6e8 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -12,6 +12,10 @@ class Account < ActiveRecord::Base has_attached_file :header, styles: { medium: '700x335#' } validates_attachment_content_type :header, content_type: /\Aimage\/.*\Z/ + # Local user profile validations + validates :display_name, length: { maximum: 30 }, if: 'local?' + validates :note, length: { maximum: 124 }, if: 'local?' + # Timelines has_many :stream_entries, inverse_of: :account has_many :statuses, inverse_of: :account |