Class: SimpleChat::ApplicationController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/simple_chat/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#simple_chat_current_userObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/simple_chat/application_controller.rb', line 5

def simple_chat_current_user
  method = SimpleChat.configuration.current_user_method
  if respond_to?(method, true)
    send(method)
  elsif defined?(Current) && Current.respond_to?(:user)
    Current.user
  else
    nil
  end
end