2017-02-24 14:48:07 -05:00

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