Skip to content

Commit

Permalink
1. fix search bug re: approval setting
Browse files Browse the repository at this point in the history
2. schema
3. remove extraneous double-extension on css
  • Loading branch information
machinehum committed Oct 30, 2023
1 parent 2c68932 commit eaec5be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/models/trial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
Expand Down
13 changes: 12 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit eaec5be

Please sign in to comment.