diff --git a/app/api/srch/search.rb b/app/api/srch/search.rb index 7c49e6f9d99..61bec709dfe 100644 --- a/app/api/srch/search.rb +++ b/app/api/srch/search.rb @@ -103,7 +103,7 @@ class Search < Grape::API if results.present? docs = results.map do |model| DocResult.new( - doc_type: 'USERS', + doc_type: 'USERS', doc_url: '/profile/' + model.name, doc_title: model.username, latitude: model.lat, @@ -181,7 +181,7 @@ class Search < Grape::API DocList.new('', search_request) end end - + # Request URL should be /api/srch/nodes?query=QRY desc 'Perform a search of nodes', hidden: false, is_array: false, diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index c1f62d971d8..f53378518a2 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -4,17 +4,15 @@ class Connection < ActionCable::Connection::Base def connect self.current_user = find_verified_user end - + def find_verified_user - if cookies.signed['user_token'] != nil + unless cookies.signed['user_token'].nil? user = User.where(persistence_token: cookies.signed['user_token']) if user.any? return user.first else return nil end - else - return nil end end end diff --git a/app/channels/room_channel.rb b/app/channels/room_channel.rb index c435da479fc..5ad0e69952e 100644 --- a/app/channels/room_channel.rb +++ b/app/channels/room_channel.rb @@ -1,6 +1,5 @@ # This is a general channel connected to all active session class RoomChannel < ApplicationCable::Channel - def subscribed stream_from "room_channel" end diff --git a/app/channels/user_channel.rb b/app/channels/user_channel.rb index df58a75d891..9403c79968a 100644 --- a/app/channels/user_channel.rb +++ b/app/channels/user_channel.rb @@ -1,6 +1,6 @@ class UserChannel < ApplicationCable::Channel def subscribed - if current_user != nil + if !current_user.nil? stream_from "users:#{current_user.id}" else reject diff --git a/app/channels/user_notification_channel.rb b/app/channels/user_notification_channel.rb index accb48deb75..04415cb27cf 100644 --- a/app/channels/user_notification_channel.rb +++ b/app/channels/user_notification_channel.rb @@ -1,6 +1,6 @@ class UserNotificationChannel < ApplicationCable::Channel def subscribed - if current_user != nil + if !current_user.nil? stream_from "users:notification:#{current_user.id}" else reject