| Class | Enterprise |
| In: |
app/models/enterprise.rb
|
| Parent: | Organization |
An enterprise is a kind of organization. According to the system concept, only enterprises can offer products and services.
# File app/models/enterprise.rb, line 54
54: def create_activation_task
55: if !self.enabled
56: EnterpriseActivation.create!(:enterprise => self, :code_length => 7)
57: end
58: end
# File app/models/enterprise.rb, line 61
61: def default_set_of_blocks
62: blocks = [
63: [MainBlock],
64: [ProfileInfoBlock, MembersBlock],
65: [RecentDocumentsBlock]
66: ]
67: if !environment.enabled?('disable_products_for_enterprises')
68: blocks[2].unshift ProductsBlock
69: end
70: blocks
71: end
# File app/models/enterprise.rb, line 36
36: def enable(owner)
37: return if enabled
38: affiliate(owner, Profile::Roles.all_roles)
39: update_attribute(:enabled,true)
40: save
41: end
# File app/models/enterprise.rb, line 11
11: def product_categories
12: products.map{|p| p.category_full_name}.compact
13: end
# File app/models/enterprise.rb, line 43
43: def question
44: if !self.foundation_year.blank?
45: :foundation_year
46: elsif !self.cnpj.blank?
47: :cnpj
48: else
49: nil
50: end
51: end
# File app/models/enterprise.rb, line 73
73: def template
74: environment.enterprise_template
75: end