From d942bec78c022f0949e3cb9399e26c8ce4f8457f Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Mon, 20 Jan 2025 13:44:52 -0500 Subject: [PATCH 1/5] I hate this, but we need to remind folks. Appears to only happen with one solr search engine? --- app/assets/templates/views/queries.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/templates/views/queries.html b/app/assets/templates/views/queries.html index a34a621d6..0a9f88324 100644 --- a/app/assets/templates/views/queries.html +++ b/app/assets/templates/views/queries.html @@ -108,6 +108,7 @@ From 03f3aebd3c12e19ecf89340a62e24550bc2cb18b Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Mon, 20 Jan 2025 13:45:03 -0500 Subject: [PATCH 2/5] nicer messaging --- app/controllers/books_controller.rb | 2 +- test/controllers/books_controller_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/books_controller.rb b/app/controllers/books_controller.rb index 47743e257..afe434953 100644 --- a/app/controllers/books_controller.rb +++ b/app/controllers/books_controller.rb @@ -213,7 +213,7 @@ def run_judge_judy number_of_pairs = nil if judge_all RunJudgeJudyJob.perform_later(@book, ai_judge, number_of_pairs) - redirect_to book_path(@book), flash: { kraken_unleashed: judge_all }, :notice => "Set AI Judge #{ai_judge.name} to work judging query/doc pairs." + redirect_to book_path(@book), flash: { kraken_unleashed: judge_all }, :notice => "AI Judge #{ai_judge.name} will start evaluating query/doc pairs." end # rubocop:enable Metrics/AbcSize # rubocop:enable Metrics/MethodLength diff --git a/test/controllers/books_controller_test.rb b/test/controllers/books_controller_test.rb index bd4b86f58..96dd74798 100644 --- a/test/controllers/books_controller_test.rb +++ b/test/controllers/books_controller_test.rb @@ -17,7 +17,7 @@ class BooksControllerTest < ActionDispatch::IntegrationTest assert_difference 'james_bond_movies.judgements.count' do patch "/books/#{james_bond_movies.id}/run_judge_judy/#{judge_judy.id}", params: { number_of_pairs: 1 } follow_redirect! - assert_equal "Set AI Judge #{judge_judy.name} to work judging query/doc pairs.", flash[:notice] + assert_equal "AI Judge #{judge_judy.name} will start evaluating query/doc pairs.", flash[:notice] end end end @@ -28,7 +28,7 @@ class BooksControllerTest < ActionDispatch::IntegrationTest patch "/books/#{james_bond_movies.id}/run_judge_judy/#{judge_judy.id}", params: { judge_all: 1, number_of_pairs: 1 } follow_redirect! - assert_equal "Set AI Judge #{judge_judy.name} to work judging query/doc pairs.", flash[:notice] + assert_equal "AI Judge #{judge_judy.name} will start evaluating query/doc pairs.", flash[:notice] assert_equal james_bond_movies.query_doc_pairs.count, james_bond_movies.judgements.where(user: judge_judy).count end end From a3c4db70105f48b0cf4e39379906a89cbd23f619 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Mon, 20 Jan 2025 13:45:39 -0500 Subject: [PATCH 3/5] wcw is still around @sstults --- config/initializers/console_commands.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 config/initializers/console_commands.rb diff --git a/config/initializers/console_commands.rb b/config/initializers/console_commands.rb new file mode 100644 index 000000000..3310045bd --- /dev/null +++ b/config/initializers/console_commands.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +Rails.application.console do + def wcw val + puts "Val: #{val}" + pp val + end +end From e4cb141644763767bcd55b4066e3f007704b858e Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Mon, 20 Jan 2025 13:45:52 -0500 Subject: [PATCH 4/5] Work when no percent provided. --- app/views/books/_blah.turbo_stream.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/books/_blah.turbo_stream.erb b/app/views/books/_blah.turbo_stream.erb index b4533a5d0..bfe2a5b4d 100644 --- a/app/views/books/_blah.turbo_stream.erb +++ b/app/views/books/_blah.turbo_stream.erb @@ -2,9 +2,11 @@ <% if counter > 0 %>