Added name uniqueness validation for organization model.
This commit is contained in:
parent
fa55224163
commit
8233116ef9
1 changed files with 5 additions and 1 deletions
|
|
@ -7,7 +7,11 @@ class Organization < ApplicationRecord
|
||||||
|
|
||||||
after_create :create_roles
|
after_create :create_roles
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name,
|
||||||
|
uniqueness: {
|
||||||
|
case_sensitive: false
|
||||||
|
},
|
||||||
|
presence: true
|
||||||
|
|
||||||
mount_uploader :picture, PictureUploader, mount_on: :picture
|
mount_uploader :picture, PictureUploader, mount_on: :picture
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue