1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #5286: find_by_ref hotFix (#525)

(cherry picked from commit fa4df3290e385e84fcba2d1e13e64f0f838aeead)
This commit is contained in:
Sergio Semedi Barranco 2017-10-13 12:56:41 +02:00 committed by Tino Vazquez
parent 248b750945
commit 512da1ee67

View File

@ -83,7 +83,10 @@ class VIHelper
one_managed = one_managed.nil? || one_managed
pool = one_pool(the_class, false) if pool.nil?
@ref_hash ||= {}
@ref_hash[attribute] ||= create_ref_hash(attribute, pool)
if @ref_hash[attribute].nil? || @ref_hash[attribute] == {}
@ref_hash[attribute] = create_ref_hash(attribute, pool)
end
e = @ref_hash[attribute][ref]