From bf0964585355fc5a2ce0ad953804d2df84f7084d Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Sun, 4 Feb 2018 16:43:34 +0530 Subject: [PATCH] Fix subscription error --- app/controllers/subscription_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subscription_controller.rb b/app/controllers/subscription_controller.rb index 001eecfda6..a0473440c4 100644 --- a/app/controllers/subscription_controller.rb +++ b/app/controllers/subscription_controller.rb @@ -53,7 +53,7 @@ def add end # test for uniqueness, handle it as a validation error if you like - if TagSelection.where(following: true, user_id: current_user.uid, tid: tag.tid).positive? + if TagSelection.where(following: true, user_id: current_user.uid, tid: tag.tid).length.positive? flash[:error] = "You are already subscribed to '#{params[:name]}'" redirect_to "/subscriptions" + "?_=" + Time.now.to_i.to_s else