From 9ede168f04418a60cc460635878908e7c5e24dbd Mon Sep 17 00:00:00 2001
From: MoisesMachado <%= link_to _('Edit'), :action => 'edit', :id => enterprise %> <%= link_to _('Delete'), :action => 'destroy', :id => enterprise %>
-<%= text_field 'enterprise', 'contact_person', 'size' => 20 %>
-<%= text_field 'enterprise', 'acronym', 'size' => 20 %>
-<%= text_field 'enterprise', 'foundation_year', 'size' => 20 %>
-<%= text_field 'enterprise', 'legal_form', 'size' => 20 %>
-<%= text_field 'enterprise', 'economic_activity', 'size' => 20 %>
-<%= text_area 'enterprise', 'management_information', 'cols' => 40, 'rows' => 20 %>
<%= _('Identifier: ') %> <%= @enterprise.identifier %>
<%= _('Address: ') %> <%= @enterprise.address %>
<%= _('Contact phone: ') %> <%= @enterprise.contact_phone %>
-<%= _('Contact person: ') %> <%= @enterprise.contact_person %>
-<%= _('Acronym: ') %> <%= @enterprise.acronym %>
-<%= _('Foundation year: ') %> <%= @enterprise.foundation_year %>
-<%= _('Legal Form: ') %> <%= @enterprise.legal_form %>
-<%= _('Economic activity: ') %> <%= @enterprise.economic_activity %>
-<%= _('Management infomation: ') %> <%= @enterprise.management_information %>
+<%= _('Contact person: ') %> <%= @enterprise.organization_info.contact_person %>
+<%= _('Acronym: ') %> <%= @enterprise.organization_info.acronym %>
+<%= _('Foundation year: ') %> <%= @enterprise.organization_info.foundation_year %>
+<%= _('Legal Form: ') %> <%= @enterprise.organization_info.legal_form %>
+<%= _('Economic activity: ') %> <%= @enterprise.organization_info.economic_activity %>
+<%= _('Management infomation: ') %> <%= @enterprise.organization_info.management_information %>
<%= link_to _('Edit enterprise'), :action => 'edit', :id => @enterprise %>
+<%= link_to _('Delete enterprise'), :action => 'destroy', :id => @enterprise %>
<%= link_to _('Register new enterprise'), :action => 'register_form' %>
diff --git a/db/migrate/003_create_profiles.rb b/db/migrate/003_create_profiles.rb index e6019dc..0c88063 100644 --- a/db/migrate/003_create_profiles.rb +++ b/db/migrate/003_create_profiles.rb @@ -9,20 +9,11 @@ class CreateProfiles < ActiveRecord::Migration t.column :flexible_template_theme, :string, :default => "default" t.column :flexible_template_icon_theme, :string, :default => "default" t.column :active, :boolean, :default => false - + t.column :address, :string + t.column :contact_phone, :string + #person fields t.column :user_id, :integer - - #enterprise fields - t.column :address, :string - t.column :contact_phone, :string - t.column :contact_person, :string - t.column :acronym, :string - t.column :foundation_year, :integer, :limit => 4 - t.column :legal_form, :string - t.column :economic_activity, :string - t.column :management_information, :string - end end diff --git a/db/migrate/009_create_organizations.rb b/db/migrate/009_create_organizations.rb new file mode 100644 index 0000000..1a3f2fc --- /dev/null +++ b/db/migrate/009_create_organizations.rb @@ -0,0 +1,10 @@ +class CreateOrganizations < ActiveRecord::Migration + def self.up + create_table :organizations do |t| + end + end + + def self.down + drop_table :organizations + end +end diff --git a/db/migrate/010_create_organization_infos.rb b/db/migrate/010_create_organization_infos.rb new file mode 100644 index 0000000..8ffe65f --- /dev/null +++ b/db/migrate/010_create_organization_infos.rb @@ -0,0 +1,17 @@ +class CreateOrganizationInfos < ActiveRecord::Migration + def self.up + create_table :organization_infos do |t| + t.column :organization_id, :integer + t.column :contact_person, :string + t.column :acronym, :string + t.column :foundation_year, :integer, :limit => 4 + t.column :legal_form, :string + t.column :economic_activity, :string + t.column :management_information, :string + end + end + + def self.down + drop_table :organization_infos + end +end diff --git a/test/fixtures/organization_infos.yml b/test/fixtures/organization_infos.yml new file mode 100644 index 0000000..b49c4eb --- /dev/null +++ b/test/fixtures/organization_infos.yml @@ -0,0 +1,5 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +one: + id: 1 +two: + id: 2 diff --git a/test/fixtures/organizations.yml b/test/fixtures/organizations.yml new file mode 100644 index 0000000..b49c4eb --- /dev/null +++ b/test/fixtures/organizations.yml @@ -0,0 +1,5 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +one: + id: 1 +two: + id: 2 diff --git a/test/unit/organization_info_test.rb b/test/unit/organization_info_test.rb new file mode 100644 index 0000000..92cf899 --- /dev/null +++ b/test/unit/organization_info_test.rb @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class OrganizationInfoTest < Test::Unit::TestCase + fixtures :organization_infos + + # Replace this with your real tests. + def test_truth + assert true + end +end diff --git a/test/unit/organization_test.rb b/test/unit/organization_test.rb new file mode 100644 index 0000000..a728ec8 --- /dev/null +++ b/test/unit/organization_test.rb @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class OrganizationTest < Test::Unit::TestCase + fixtures :organizations + + # Replace this with your real tests. + def test_truth + assert true + end +end -- libgit2 0.21.2