Make the uniqueness of the name of a group expicit in the model
This commit is contained in:
parent
eb8241cf04
commit
db4c29ff1b
1 changed files with 1 additions and 0 deletions
|
@ -9,6 +9,7 @@ class Group < ApplicationRecord
|
|||
has_many :users, -> { where(deleted_at: nil) }, through: :memberships
|
||||
|
||||
validates :name, :presence => true, :length => {:in => 1..25}
|
||||
validates_uniqueness_of :name
|
||||
|
||||
attr_reader :user_tokens
|
||||
|
||||
|
|
Loading…
Reference in a new issue