diff --git a/app/models/table.rb b/app/models/table.rb index 4e07726..8bfec1e 100644 --- a/app/models/table.rb +++ b/app/models/table.rb @@ -5,7 +5,8 @@ class Table < ApplicationRecord belongs_to :game_system validates :name, presence: true, - length: { maximum: 100 } + length: { maximum: 100 }, + uniqueness: { scope: :owner_id, message: I18n.t("errors.unique_table_name") } validates :slug, presence: true, length: { maximum: 100 }, uniqueness: true diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5562422..a006677 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,6 +18,7 @@