From 44062abc91e662d938d2e8f1282334fbc2048187 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Sat, 20 Oct 2007 00:33:03 +0000 Subject: [PATCH] ActionItem111: fixed some interface issues --- app/models/organization.rb | 6 +++++- app/views/profile_editor/index.rhtml | 6 ++---- script/anhetegua | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/models/organization.rb b/app/models/organization.rb index 26d8a60..2668b18 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,11 +1,15 @@ # Represents any organization of the system and has an organization_info object to hold its info -class Organization < Profile +class Organization < Profile has_one :organization_info belongs_to :region has_one :validation_info + after_create do |org| + OrganizationInfo.create!(:organization_id => org.id) + end + def validation_methodology methodology = self.validation_info ? self.validation_info.validation_methodology : nil methodology || ('' + _('(not informed)') + '') diff --git a/app/views/profile_editor/index.rhtml b/app/views/profile_editor/index.rhtml index 9b6e4f0..ffc5753 100644 --- a/app/views/profile_editor/index.rhtml +++ b/app/views/profile_editor/index.rhtml @@ -10,10 +10,8 @@ <% end %> + diff --git a/script/anhetegua b/script/anhetegua index ff129e6..820ba6e 100644 --- a/script/anhetegua +++ b/script/anhetegua @@ -61,7 +61,7 @@ RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => nil) RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero) # Sample user and sample enterprise owned by him -ze= User.create!(:login => 'ze', :email => 'ze@localhost.localdomain', :password => 'test', :password_confirmation => 'test') +ze= User.create!(:login => 'ze', :email => 'ze@localhost.localdomain', :password => 'test', :password_confirmation => 'test').person empa = Enterprise.create!(:name => 'Empreendimento A', :identifier => 'empreendimento_a') RoleAssignment.create!(:accessor => ze, :role => owner_role, :resource => empa) -- libgit2 0.21.2