From 385e299db75fd782a0b1925affa5076c21c62c5d Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Wed, 26 Feb 2025 09:15:13 +0000 Subject: [PATCH] Simplify param --- app/controllers/buckets/subscriptions_controller.rb | 2 +- app/views/notifications/settings/_bucket.html.erb | 4 ++-- test/controllers/buckets/subscriptions_controller_test.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/buckets/subscriptions_controller.rb b/app/controllers/buckets/subscriptions_controller.rb index 9827ce770..a5a3b92f7 100644 --- a/app/controllers/buckets/subscriptions_controller.rb +++ b/app/controllers/buckets/subscriptions_controller.rb @@ -2,7 +2,7 @@ class Buckets::SubscriptionsController < ApplicationController include BucketScoped def update - if params[:subscribed] == "1" + if params[:subscribed] @bucket.subscribe(Current.user) else @bucket.unsubscribe(Current.user) diff --git a/app/views/notifications/settings/_bucket.html.erb b/app/views/notifications/settings/_bucket.html.erb index 25531963d..2ca8ca2f4 100644 --- a/app/views/notifications/settings/_bucket.html.erb +++ b/app/views/notifications/settings/_bucket.html.erb @@ -8,8 +8,8 @@ diff --git a/test/controllers/buckets/subscriptions_controller_test.rb b/test/controllers/buckets/subscriptions_controller_test.rb index e6d75778c..a884db57c 100644 --- a/test/controllers/buckets/subscriptions_controller_test.rb +++ b/test/controllers/buckets/subscriptions_controller_test.rb @@ -17,7 +17,7 @@ class Buckets::SubscriptionsControllerTest < ActionDispatch::IntegrationTest buckets(:writebook).subscribe(users(:jz)) assert_changes -> { buckets(:writebook).subscribed_by?(users(:jz)) }, from: true, to: false do - put bucket_subscriptions_url(buckets(:writebook)), params: { subscribed: "0" } + put bucket_subscriptions_url(buckets(:writebook)) end assert_response :success