diff --git a/Gemfile b/Gemfile index d678adf..fb21469 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'rails', '~> 7.0', '>= 7.0.2.3' # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' -gem 'mysql2', '~> 0.5.3' +gem 'mysql2', '~> 0.5.6' gem 'puma', '~> 5.0' # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] gem 'importmap-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 733eb31..cab7dcb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -149,7 +149,7 @@ GEM mini_mime (1.1.2) minitest (5.15.0) msgpack (1.5.0) - mysql2 (0.5.3) + mysql2 (0.5.6) net-imap (0.2.3) digest net-protocol @@ -165,6 +165,10 @@ GEM net-protocol timeout nio4r (2.5.8) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) + nokogiri (1.13.3-arm64-darwin) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) octicons (17.0.0) @@ -265,6 +269,8 @@ GEM zeitwerk (2.5.4) PLATFORMS + aarch64-linux + arm64-darwin-23 x86_64-linux DEPENDENCIES @@ -281,7 +287,7 @@ DEPENDENCIES jquery-rails (~> 4.4) kaminari (~> 1.2, >= 1.2.2) lograge (~> 0.11) - mysql2 (~> 0.5.3) + mysql2 (~> 0.5.6) octicons_helper okcomputer puma (~> 5.0) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index fdec1cf..5230172 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -6,13 +6,21 @@ def index end def sort - if (User.column_names.include?(params[:sort]) && %w[asc desc].include?(params[:direction])) - "#{params[:sort]} #{params[:direction]}, name" + Rails.logger.info("registrations: params #{params}") + + case params[:sort] + when 'Requested Tier' + "role #{params[:direction]}, name" + when 'Approved Tier' + "tier_id #{params[:direction]}, name" + when 'Registered Date' + "created_at #{params[:direction]}, name" else :name end end + # @deprecated def sort_direction %w[asc desc].include?(params[:direction]) ? params[:direction] : "asc" end diff --git a/app/views/registrations/_registrations.html.erb b/app/views/registrations/_registrations.html.erb index 73c9cc4..2c4a4de 100644 --- a/app/views/registrations/_registrations.html.erb +++ b/app/views/registrations/_registrations.html.erb @@ -7,7 +7,7 @@