diff --git a/app/models/university/organization.rb b/app/models/university/organization.rb index 1083a766945cbc9e77afbae2457ac2b164a8f3c5..9cdd65b6915ff386e3e333d4b83de8864d5a2111 100644 --- a/app/models/university/organization.rb +++ b/app/models/university/organization.rb @@ -74,7 +74,7 @@ class University::Organization < ApplicationRecord has_one_attached_deletable :logo_on_dark_background validates_presence_of :name - validates_uniqueness_of :name, scope: :university_id + validates_uniqueness_of :name, scope: [:university_id, :language_id] validates :logo, size: { less_than: 1.megabytes } validates :logo_on_dark_background, size: { less_than: 1.megabytes } # Organization can be created from extranet with only their name. Be careful for future validators. diff --git a/db/schema.rb b/db/schema.rb index 6366c92c831c4123214b9879a7911640c4f40d33..fa52bb2e18d59a435196d29a5ff37709181ce345 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -105,8 +105,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_05_103400) do t.datetime "updated_at", null: false t.string "title" t.boolean "published", default: true - t.uuid "heading_id" t.uuid "communication_website_id" + t.uuid "heading_id" t.index ["about_type", "about_id"], name: "index_communication_website_blocks_on_about" t.index ["communication_website_id"], name: "index_communication_blocks_on_communication_website_id" t.index ["heading_id"], name: "index_communication_blocks_on_heading_id" @@ -223,6 +223,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_05_103400) do t.text "home_sentence" t.text "sass" t.text "css" + t.boolean "allow_experiences_modification", default: true t.index ["about_type", "about_id"], name: "index_communication_extranets_on_about" t.index ["university_id"], name: "index_communication_extranets_on_university_id" end @@ -461,7 +462,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_05_103400) do t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end - create_table "communication_website_permalinks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_permalinks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.string "about_type", null: false