Class: ApplicationController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/application_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user


17
18
19
# File 'app/controllers/application_controller.rb', line 17

def current_user
  @current_user
end

Instance Method Details

#fake_user(user) ⇒ Object


19
20
21
22
23
# File 'app/controllers/application_controller.rb', line 19

def fake_user(user)
  raise "only for testing" unless Rails.env.test?
  @current_user = user
  @current_user.identity ||= {}
end