diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb index 6a476825a..293dfadcb 100644 --- a/app/models/communication/extranet.rb +++ b/app/models/communication/extranet.rb @@ -22,7 +22,7 @@ # created_at :datetime not null # updated_at :datetime not null # about_id :uuid indexed => [about_type] -# default_language_id :uuid not null, indexed +# default_language_id :uuid indexed # university_id :uuid not null, indexed # # Indexes diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index 21b2e59f0..486cb77c2 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -4,7 +4,6 @@ # # id :uuid not null, primary key # bodyclass :string -# design_options :jsonb # full_width :boolean default(FALSE) # migration_identifier :string # position :integer default(0), not null diff --git a/app/models/communication/website/page/localization.rb b/app/models/communication/website/page/localization.rb index 867d84ac5..847edc686 100644 --- a/app/models/communication/website/page/localization.rb +++ b/app/models/communication/website/page/localization.rb @@ -9,7 +9,7 @@ # header_cta :boolean # header_cta_label :string # header_cta_url :string -# header_text :text +# header_text :string # meta_description :string # migration_identifier :string # published :boolean diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index 482f5e2a3..68de8dfc0 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -71,7 +71,7 @@ class Communication::Website::Post < ApplicationRecord } scope :latest_in, -> (language) { published_now_in(language).order("communication_website_post_localizations.published_at DESC").limit(5) } - scope :for_author, -> (author_id, language = nil) { where(author_id: author_id) } + scope :for_authors, -> (author_ids, language = nil) { joins(:authors).where(communication_website_post_authors: { id: author_ids }).distinct } scope :for_category, -> (category_id, language = nil) { joins(:categories).where(communication_website_post_categories: { id: category_id }).distinct } scope :for_search_term, -> (term, language) { joins(:localizations) diff --git a/app/models/university/person/localization.rb b/app/models/university/person/localization.rb index 2da26591f..660a9c0e3 100644 --- a/app/models/university/person/localization.rb +++ b/app/models/university/person/localization.rb @@ -3,7 +3,7 @@ # Table name: university_person_localizations # # id :uuid not null, primary key -# biography :text +# biography :string # first_name :string # last_name :string # linkedin :string diff --git a/app/views/admin/communication/websites/posts/_filters.html.erb b/app/views/admin/communication/websites/posts/_filters.html.erb index 561016282..d5cc4c352 100644 --- a/app/views/admin/communication/websites/posts/_filters.html.erb +++ b/app/views/admin/communication/websites/posts/_filters.html.erb @@ -10,7 +10,7 @@ <%= render_filter f, :select, :for_author, - label: t('filters.attributes.element', element: Communication::Website::Post.human_attribute_name(:author).downcase), + label: t('filters.attributes.element', element: t('communication.authors', count: 1).downcase), collection: osuny_collection(website.authors, localized: true), multiple: true %> diff --git a/db/schema.rb b/db/schema.rb index f85997ed5..0235d20de 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -334,7 +334,7 @@ t.boolean "feature_jobs", default: false t.text "sass" t.text "css" - t.uuid "default_language_id", null: false + t.uuid "default_language_id" t.index ["about_type", "about_id"], name: "index_communication_extranets_on_about" t.index ["default_language_id"], name: "index_communication_extranets_on_default_language_id" t.index ["university_id"], name: "index_communication_extranets_on_university_id" @@ -544,39 +544,6 @@ t.index ["university_id"], name: "index_communication_website_menus_on_university_id" end - create_table "communication_website_page_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.boolean "is_taxonomy", default: false - t.integer "position" - t.uuid "communication_website_id", null: false - t.uuid "parent_id" - t.uuid "university_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["communication_website_id"], name: "idx_communication_website_page_cats_on_website_id" - t.index ["parent_id"], name: "index_communication_website_page_categories_on_parent_id" - t.index ["university_id"], name: "index_communication_website_page_categories_on_university_id" - end - - create_table "communication_website_page_category_localizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.string "name" - t.string "slug" - t.string "path" - t.text "meta_description" - t.text "summary" - t.text "featured_image_alt" - t.text "featured_image_credit" - t.uuid "about_id" - t.uuid "language_id" - t.uuid "communication_website_id", null: false - t.uuid "university_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["about_id"], name: "idx_on_about_id_6c76163c36" - t.index ["communication_website_id"], name: "idx_on_communication_website_id_f605face95" - t.index ["language_id"], name: "idx_on_language_id_adc4ce8d8e" - t.index ["university_id"], name: "idx_on_university_id_2237677b2f" - end - create_table "communication_website_page_localizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "breadcrumb_title" t.string "featured_image_alt" @@ -584,7 +551,7 @@ t.boolean "header_cta" t.string "header_cta_label" t.string "header_cta_url" - t.text "header_text" + t.string "header_text" t.string "meta_description" t.string "migration_identifier" t.boolean "published" @@ -618,19 +585,11 @@ t.boolean "full_width", default: false t.string "type" t.string "migration_identifier" - t.jsonb "design_options" t.index ["communication_website_id"], name: "index_communication_website_pages_on_communication_website_id" t.index ["parent_id"], name: "index_communication_website_pages_on_parent_id" t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end - create_table "communication_website_pages_categories", id: false, force: :cascade do |t| - t.uuid "communication_website_page_id", null: false - t.uuid "communication_website_page_category_id", null: false - t.index ["communication_website_page_category_id", "communication_website_page_id"], name: "idx_on_communication_website_page_category_id_commu_0ed05f8637" - t.index ["communication_website_page_id", "communication_website_page_category_id"], name: "idx_on_communication_website_page_id_communication__6ff1d70f62" - end - create_table "communication_website_permalinks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false @@ -1484,27 +1443,6 @@ t.index ["university_id"], name: "index_research_thesis_localizations_on_university_id" end - create_table "search_index", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.uuid "university_id", null: false - t.string "title" - t.text "text" - t.uuid "language_id", null: false - t.string "about_object_type", null: false - t.uuid "about_object_id", null: false - t.string "about_localization_type", null: false - t.uuid "about_localization_id", null: false - t.uuid "website_id" - t.uuid "extranet_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["about_localization_type", "about_localization_id"], name: "index_search_on_about_localization" - t.index ["about_object_type", "about_object_id"], name: "index_search_on_about_object" - t.index ["extranet_id"], name: "index_search_index_on_extranet_id" - t.index ["language_id"], name: "index_search_index_on_language_id" - t.index ["university_id"], name: "index_search_index_on_university_id" - t.index ["website_id"], name: "index_search_index_on_website_id" - end - create_table "universities", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "identifier" @@ -1750,7 +1688,7 @@ end create_table "university_person_localizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.text "biography" + t.string "biography" t.string "first_name" t.string "last_name" t.string "linkedin" @@ -1935,13 +1873,6 @@ add_foreign_key "communication_website_menus", "communication_websites" add_foreign_key "communication_website_menus", "languages" add_foreign_key "communication_website_menus", "universities" - add_foreign_key "communication_website_page_categories", "communication_website_page_categories", column: "parent_id" - add_foreign_key "communication_website_page_categories", "communication_websites" - add_foreign_key "communication_website_page_categories", "universities" - add_foreign_key "communication_website_page_category_localizations", "communication_website_page_categories", column: "about_id" - add_foreign_key "communication_website_page_category_localizations", "communication_websites" - add_foreign_key "communication_website_page_category_localizations", "languages" - add_foreign_key "communication_website_page_category_localizations", "universities" add_foreign_key "communication_website_page_localizations", "communication_website_pages", column: "about_id" add_foreign_key "communication_website_page_localizations", "communication_websites" add_foreign_key "communication_website_page_localizations", "languages" @@ -2049,9 +1980,6 @@ add_foreign_key "research_thesis_localizations", "languages" add_foreign_key "research_thesis_localizations", "research_theses", column: "about_id" add_foreign_key "research_thesis_localizations", "universities" - add_foreign_key "search_index", "communication_extranets", column: "extranet_id" - add_foreign_key "search_index", "communication_websites", column: "website_id" - add_foreign_key "search_index", "universities" add_foreign_key "universities", "languages", column: "default_language_id" add_foreign_key "university_apps", "universities" add_foreign_key "university_organization_categories", "universities"