diff --git a/app/models/trial.rb b/app/models/trial.rb index ec4a5f3..97cac23 100644 --- a/app/models/trial.rb +++ b/app/models/trial.rb @@ -555,7 +555,9 @@ def self.is_nct_number?(value) def self.filters(search) ret = [] ret << { term: { visible: true } } - ret << { term: { approved: true } } + if SystemInfo.trial_approval + ret << { term: { approved: true } } + end if (search.has_key?('healthy_volunteers') and search[:healthy_volunteers] == "1") or search.has_key?('category') or search.has_key?('subcat') or search.has_key?('gender') if search.has_key?('healthy_volunteers') and search[:healthy_volunteers] == "1" ret << { term: { healthy_volunteers: true } } diff --git a/db/schema.rb b/db/schema.rb index c15b9fa..7daa65f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_10_25_203753) do +ActiveRecord::Schema[7.1].define(version: 2023_10_25_203753) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -228,6 +228,15 @@ t.datetime "updated_at", precision: nil, null: false end + create_table "study_finder_trial_subgroups", force: :cascade do |t| + t.bigint "subgroup_id", null: false + t.bigint "trial_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["subgroup_id"], name: "index_study_finder_trial_subgroups_on_subgroup_id" + t.index ["trial_id"], name: "index_study_finder_trial_subgroups_on_trial_id" + end + create_table "study_finder_trials", id: :serial, force: :cascade do |t| t.string "system_id" t.string "brief_title", limit: 1000 @@ -331,4 +340,6 @@ add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" + add_foreign_key "study_finder_trial_subgroups", "study_finder_subgroups", column: "subgroup_id" + add_foreign_key "study_finder_trial_subgroups", "study_finder_trials", column: "trial_id" end