Skip to content

Commit

Permalink
Fix subscription error
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhptr committed Feb 5, 2018
1 parent b978d2b commit bf09645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/subscription_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf09645

Please sign in to comment.