From a4a43496b06ffbc86926fee1b05011c86a247679 Mon Sep 17 00:00:00 2001 From: rsmokeUM Date: Wed, 11 Mar 2026 17:31:37 -0400 Subject: [PATCH 1/3] Fix spelling in ActiveAdmin menu parent for Applications and Users --- app/admin/applications.rb | 2 +- app/admin/users.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/applications.rb b/app/admin/applications.rb index 2f23f53..c88fe62 100644 --- a/app/admin/applications.rb +++ b/app/admin/applications.rb @@ -1,5 +1,5 @@ ActiveAdmin.register Application do - menu parent: "User Mangement", priority: 1 + menu parent: "User Management", priority: 1 # See permitted parameters documentation: # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters # diff --git a/app/admin/users.rb b/app/admin/users.rb index 6f43f21..4e45ba2 100644 --- a/app/admin/users.rb +++ b/app/admin/users.rb @@ -1,5 +1,5 @@ ActiveAdmin.register User do - menu parent: "User Mangement", priority: 3 + menu parent: "User Management", priority: 3 # See permitted parameters documentation: # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters From 752ee898d50a3202a046d64ca4489b77b4d8ac9d Mon Sep 17 00:00:00 2001 From: rsmokeUM Date: Wed, 11 Mar 2026 17:47:21 -0400 Subject: [PATCH 2/3] Update application model and ActiveAdmin filters to include applications_conf_year for improved attribute clarity and search functionality. --- app/admin/applications.rb | 2 +- app/models/application.rb | 7 ++++++- spec/models/application_spec.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/admin/applications.rb b/app/admin/applications.rb index c88fe62..1da5a78 100644 --- a/app/admin/applications.rb +++ b/app/admin/applications.rb @@ -34,7 +34,7 @@ filter :lodging_selection, as: :select, collection: -> { Lodging.all.map { |lapp| [lapp.description, lapp.description]}.sort } filter :partner_registration_id, as: :select, collection: -> { PartnerRegistration.all.map { |papp| [papp.description, papp.id]}.sort } filter :subscription, as: :select - filter :conf_year, as: :select + filter :applications_conf_year, as: :select, label: "Conf Year" controller do before_action :load_index_batch_data, only: [:index] diff --git a/app/models/application.rb b/app/models/application.rb index 49e40f5..f1424c1 100644 --- a/app/models/application.rb +++ b/app/models/application.rb @@ -67,7 +67,12 @@ def self.ransackable_associations(auth_object = nil) end def self.ransackable_attributes(auth_object = nil) - ["accessibility_requirements", "birth_year", "city", "conf_year", "country", "created_at", "email", "email_confirmation", "first_name", "food_restrictions", "gender", "how_did_you_hear", "id", "id_value", "last_name", "lodging_selection", "lottery_position", "offer_status", "offer_status_date", "partner_first_name", "partner_last_name", "partner_registration_id", "partner_registration_selection", "phone", "result_email_sent", "special_lodging_request", "state", "street", "street2", "subscription", "updated_at", "user_id", "workshop_selection1", "workshop_selection2", "workshop_selection3", "zip"] + ["accessibility_requirements", "applications_conf_year", "birth_year", "city", "conf_year", "country", "created_at", "email", "email_confirmation", "first_name", "food_restrictions", "gender", "how_did_you_hear", "id", "id_value", "last_name", "lodging_selection", "lottery_position", "offer_status", "offer_status_date", "partner_first_name", "partner_last_name", "partner_registration_id", "partner_registration_selection", "phone", "result_email_sent", "special_lodging_request", "state", "street", "street2", "subscription", "updated_at", "user_id", "workshop_selection1", "workshop_selection2", "workshop_selection3", "zip"] + end + + # Disambiguate conf_year when joining associated tables in Ransack searches. + ransacker :applications_conf_year do |parent| + parent.table[:conf_year] end HOW_DID_YOU_HEAR = ["---", "Word of Mouth", "Magazine Advertisement", "Online Advertisement", "Newspaper Advertisement", "Other"] diff --git a/spec/models/application_spec.rb b/spec/models/application_spec.rb index c1aa56b..97c4c43 100644 --- a/spec/models/application_spec.rb +++ b/spec/models/application_spec.rb @@ -298,7 +298,7 @@ describe '.ransackable_attributes' do it 'returns the correct attributes' do expected_attributes = [ - "accessibility_requirements", "birth_year", "city", "conf_year", "country", + "accessibility_requirements", "applications_conf_year", "birth_year", "city", "conf_year", "country", "created_at", "email", "email_confirmation", "first_name", "food_restrictions", "gender", "how_did_you_hear", "id", "id_value", "last_name", "lodging_selection", "lottery_position", "offer_status", "offer_status_date", "partner_first_name", From 782a6b7771a4a8ce97136321974ba76ea87d2059 Mon Sep 17 00:00:00 2001 From: rsmokeUM Date: Wed, 11 Mar 2026 17:54:24 -0400 Subject: [PATCH 3/3] Refactor current_conference_payments scope in Payment model to use Arel for improved query clarity and performance. --- app/models/payment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/payment.rb b/app/models/payment.rb index ba1fd8c..b8ca484 100644 --- a/app/models/payment.rb +++ b/app/models/payment.rb @@ -44,7 +44,7 @@ def self.ransackable_attributes(auth_object = nil) end - scope :current_conference_payments, -> { where('conf_year = ? ', ApplicationSetting.get_current_app_year) } + scope :current_conference_payments, -> { where(arel_table[:conf_year].eq(ApplicationSetting.get_current_app_year)) } def manual_payment_decimal if self.transaction_type == "ManuallyEntered"