Skip to content

Commit

Permalink
Inverted negation for if/else statement (#11484)
Browse files Browse the repository at this point in the history
- Inverted the statement such that when the user is nil,there is a rejection
Fixes #11417
  • Loading branch information
Emenyi Nelly N authored Oct 14, 2022
1 parent 21dfe4c commit 9c25346
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/channels/user_channel.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class UserChannel < ApplicationCable::Channel
def subscribed
if !current_user.nil?
stream_from "users:#{current_user.id}"
else
if current_user.nil?
reject
else
stream_from "users:#{current_user.id}"
end
end

Expand Down

0 comments on commit 9c25346

Please sign in to comment.