Project

General

Profile

« Previous | Next » 

Revision 0a4afc42

Added by Marc Dequènes about 15 years ago

  • ID 0a4afc42e6a59fd5c7fb456215e12b586d50835c

[cleanup] minor simplifications in LdapObject

View differences:

lib/ldap_shadows/elements/object.rb
end
def self.possible_aspects
return [] unless self.parameters[:presentation][:allowed_aspects]
self.parameters[:presentation][:allowed_aspects].collect{|key| key.to_s }.sort
end
......
end
def self.possible_attributes_for_aspect(aspect)
aspect_data = self.shadow.get_aspect(aspect).parameters
self.objectclasses_attr_list(aspect_data[:mapping][:classes])
self.objectclasses_attr_list(self.shadow.get_aspect(aspect).parameters[:mapping][:classes])
end
def info_for_relation(rel)
......
end
def nonempty_attributes
self.attributes.collect{|key, val| (val.nil? or val == []) ? nil : key }.compact
self.attributes.collect{|key, val| val.blank? ? nil : key }.compact
end
def missing_attributes
......
end
def check_hooks_after(action)
# TODO: move this in the LdapAspect class
self.aspects.each do |aspect|
aklass = self.class.shadow.get_aspect(aspect)
next if aklass.nil?
......
end
end
# TODO: move this in the LdapAspect class
case action
when :save
if self.new_entry?

Also available in: Unified diff