diff --git a/app/controllers/enterprise_controller.rb b/app/controllers/enterprise_controller.rb index d90082d..6900150 100644 --- a/app/controllers/enterprise_controller.rb +++ b/app/controllers/enterprise_controller.rb @@ -22,6 +22,7 @@ class EnterpriseController < ApplicationController def register_form @enterprise = Enterprise.new() @vitual_communities = VirtualCommunity.find(:all) + @validation_entities = Organization.find(:all) end def register diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 1a46e1e..25f0875 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -1,3 +1,4 @@ -#An enterprise is a kind of profile. According to the system concept, only enterprises can offer products/services +#An enterprise is a kind of organization. According to the system concept, only enterprises can offer products/services and ahave to be validated by an validation entity class Enterprise < Organization + belongs_to :validation_entity, :class_name => 'organization' end diff --git a/app/models/organization.rb b/app/models/organization.rb index 5d6bd69..273cbf2 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -2,4 +2,5 @@ class Organization < Profile has_one :organization_info has_many :affiliations has_many :people, :through => :affiliations + has_many :validated_enterprises, :class_name => 'enterprise' end diff --git a/app/views/enterprise/_form.rhtml b/app/views/enterprise/_form.rhtml index e0d104c..4d0b659 100644 --- a/app/views/enterprise/_form.rhtml +++ b/app/views/enterprise/_form.rhtml @@ -24,3 +24,6 @@
<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %>
+<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id] } %>