Project

General

Profile

« Previous | Next » 

Revision a987d14b

Added by Marc Dequènes over 15 years ago

  • ID a987d14bef24ab8eeda765fb3924ceea6b340a05

[fix] for non-enumeration association the object was not loaded when requested with the target() method, so now test existance with exists?() instead which forces loading

View differences:

lib/ldap_shadows/display_utils.rb
next if rel_data.empty?
rel_value = rel_data.collect{|g| g.name }.join(", ")
else
next if rel_data.target.nil?
# the exists? method also ensure the object is loaded
next unless rel_data.exists?
rel_value = rel_data.name
end
puts "#{rel}: " + rel_value
lib/ldap_shadows/object.rb
end
def fetch_relations_data(rel_list, expert_attributes)
p rel_list
rel_data = rel_list.collect do |rel|
data = self.send(rel)
if data.is_a? Enumerable
......
multiple = true
end
else
if data.target.nil?
# the exists? method also ensure the object is loaded
if data.exists?
value = nil
else
value = data.name

Also available in: Unified diff