diff --git a/app/controllers/basil_controller.rb b/app/controllers/basil_controller.rb index 06bbbb20..fd55a8b4 100644 --- a/app/controllers/basil_controller.rb +++ b/app/controllers/basil_controller.rb @@ -189,7 +189,7 @@ class BasilController < ApplicationController commission.update( completed_at: DateTime.current, - final_settings: JSON.parse(params.fetch(:settings, {})) + final_settings: JSON.parse(params[:settings]) ) # TODO: we should attach the S3 object to the commission.image attachment @@ -224,4 +224,15 @@ class BasilController < ApplicationController feedback = commission.basil_feedbacks.find_or_initialize_by(user: current_user) feedback.update!(score_adjustment: score_adjustment) end + + def help_rate + # Commissions without feedback: + reviewed_commission_ids = BasilFeedback.where(user: current_user) + .pluck(:basil_commission_id) + @commissions = BasilCommission.where.not(id: reviewed_commission_ids) + .where.not(completed_at: nil) + .order(created_at: :desc) + .limit(50) + .includes(:entity) + end end diff --git a/app/views/basil/help_rate.html.erb b/app/views/basil/help_rate.html.erb new file mode 100644 index 00000000..aea74187 --- /dev/null +++ b/app/views/basil/help_rate.html.erb @@ -0,0 +1,100 @@ +
+ NEW: You can also + <%= link_to 'help me get better by leaving feedback', basil_rating_queue_path %>. +
diff --git a/config/routes.rb b/config/routes.rb index dcae9058..25c1ce34 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,8 @@ Rails.application.routes.draw do post '/complete/:jobid', to: 'basil#complete_commission' post '/feedback/:jobid', to: 'basil#feedback', as: :basil_feedback + get '/help/rate', to: 'basil#help_rate', as: :basil_rating_queue + get '/info', to: 'basil#info' get '/review', to: 'basil#review' end