diff --git a/app/models/list.rb b/app/models/list.rb index 77bec53b..19305b7b 100644 --- a/app/models/list.rb +++ b/app/models/list.rb @@ -6,7 +6,9 @@ class List < ApplicationRecord belongs_to :user has_many :list_members, dependent: :destroy - validates :name, length: { minimum: 1 } + validates :name, + length: { minimum: 1 }, + uniqueness: { scope: :user_id } validates :display_name, length: { maximum: 30 } before_validation do