Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/toaster/model/user.rb

Class Method Summary collapse

Class Method Details

.get_current_userObject



17
18
19
# File 'lib/toaster/model/user.rb', line 17

def self.get_current_user()
  @@current_user
end

.get_local_userObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/toaster/model/user.rb', line 20

def self.get_local_user()
  u = User.find(
    :email => "local@localhost"
  )
  return u if u
  u = User.create(
    :email => "local@localhost",
    :encrypted_password => ""
  )
  u.save
  return u
end

.set_current_user(user) ⇒ Object



14
15
16
# File 'lib/toaster/model/user.rb', line 14

def self.set_current_user(user)
  @@current_user = user
end