Skip to content
Permalink
Browse files

Add max group length name

Helps with #673
  • Loading branch information...
nikolai-b committed May 15, 2019
1 parent 75edbf0 commit 7a41c3757df93150e091d5c4d3e19a23536897ee
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/models/group.rb
  2. +1 −1 app/models/group_request.rb
@@ -31,7 +31,7 @@ class Group < ApplicationRecord
has_one :profile, class_name: "GroupProfile", dependent: :destroy, inverse_of: :group
has_one :prefs, class_name: "GroupPref", dependent: :destroy

validates :name, presence: true, uniqueness: true
validates :name, presence: true, uniqueness: true, length: { maximum: 56 }
validates :short_name, presence: true, uniqueness: true, subdomain: true
validates :default_thread_privacy, inclusion: { in: MessageThread::ALLOWED_PRIVACY }

@@ -32,7 +32,7 @@ class GroupRequest < ApplicationRecord
belongs_to :actioned_by, class_name: "User"

validates :user, :name, :short_name, :email, presence: true
validates :name, :short_name, :email, uniqueness: true
validates :name, :short_name, :email, uniqueness: true, length: { maximum: 56 }
validate :name_is_not_taken, :short_name_is_not_taken, :email_is_not_taken, unless: :confirmed?
validates :short_name, subdomain: true
validates :default_thread_privacy, inclusion: { in: MessageThread::ALLOWED_PRIVACY }

0 comments on commit 7a41c37

Please sign in to comment.
You can’t perform that action at this time.