Project

General

Profile

« Previous | Next » 

Revision 560c7b40

Added by Marc Dequènes about 15 years ago

  • ID 560c7b40c0c0635a3c3e6b4a7887ef8bbda0037e

[fix] ensure removing an aspect also remove reverse-depends

View differences:

TODO
- ensure removing an aspect also remove reverse-depends
- improve configuration:
* allow global relations to share them among objects ???
- select parent at creation with :parent if present, or use
lib/ldap_shadows/elements/object.rb
def remove_aspect(aspect_name)
return unless self.class.possible_aspects.include?(aspect_name)
# remove reverse-depends
self.class.possible_aspects.each do |rdep_aspect_name|
if self.class.shadow.get_aspect(rdep_aspect_name).parameters[:mapping][:depend_aspects].include?(aspect_name)
remove_aspect(rdep_aspect_name)
end
end
aspect_mapping = self.class.shadow.get_aspect(aspect_name).parameters[:mapping]
remove_class(*aspect_mapping[:classes])
end

Also available in: Unified diff