Fixed org lookup, use model with full attributes.
This commit is contained in:
parent
c88d7eedf8
commit
9123533f1b
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue