From 9272da5ee89ec34d72320020c78cd8298df03cdb Mon Sep 17 00:00:00 2001 From: Brunno Souza Date: Thu, 17 Sep 2020 14:28:03 -0300 Subject: [PATCH] Remove exceeded line (#10290) --- app/controllers/chat_channel_memberships_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/chat_channel_memberships_controller.rb b/app/controllers/chat_channel_memberships_controller.rb index 274de89b9..b3aedf70c 100644 --- a/app/controllers/chat_channel_memberships_controller.rb +++ b/app/controllers/chat_channel_memberships_controller.rb @@ -188,8 +188,7 @@ class ChatChannelMembershipsController < ApplicationController if params[:user_action] == "accept" membership = ChatChannelMembership.find_by(user_id: current_user.id, chat_channel_id: chat_channel.id) if !membership - membership = ChatChannelMembership.new(user_id: current_user.id, chat_channel_id: chat_channel.id) - membership.save + membership = ChatChannelMembership.create(user_id: current_user.id, chat_channel_id: chat_channel.id) unless membership&.errors&.any? send_chat_action_message("@#{membership.user.username} join the channel", current_user, chat_channel.id, "joined")