Validations for local profiles
This commit is contained in:
parent
5c99e304e5
commit
a9db42a956
3 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue