Class: User

Inherits:
ApplicationRecord show all
Defined in:
app/models/user.rb

Instance Method Summary collapse

Instance Method Details

#after_database_authenticationObject



12
13
14
15
16
17
18
# File 'app/models/user.rb', line 12

def after_database_authentication
  if !self.admin
    Apartment::Tenant.switch!(Company.find(self.company_id).company_name.gsub(/'/,'').gsub(/\s/,''))
  else
    Apartment::Tenant.switch!
  end
end