mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 19:57:41 +00:00
16 lines
295 B
Ruby
16 lines
295 B
Ruby
class Company < ApplicationRecord
|
|
has_many :users
|
|
has_many :runs
|
|
|
|
after_create :create_tenant
|
|
|
|
private
|
|
|
|
def create_tenant
|
|
if company_name != "IVA"
|
|
Apartment::Tenant.create(company_name.gsub(/'/,'').gsub(/\s/,''))
|
|
Apartment::Tenant.switch!
|
|
end
|
|
end
|
|
end
|