From 9123533f1b96dbe6fe6a92997d78e0b541d7e5a9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 1 Oct 2013 20:31:36 +0200 Subject: [PATCH] Fixed org lookup, use model with full attributes. --- app/models/organization/search.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/organization/search.rb b/app/models/organization/search.rb index c24969d29..c6275ffa1 100644 --- a/app/models/organization/search.rb +++ b/app/models/organization/search.rb @@ -45,15 +45,16 @@ returns :order => 'organizations.name' ) organizations_by_user.each {|organization_by_user| - puts 'OOO ' + organization_by_user.inspect organization_exists = false organizations.each {|organization| if organization.id == organization_by_user.id organization_exists = true end } + + # get model with full data if !organization_exists - organizations.push organization_by_user + organizations.push Organization.find(organization_by_user) end } end