[activeldap-discuss] Question about ActiveLdap::Base.delete_all
alexey.chebotar at gmail.com
Thu Jul 30 04:38:37 EDT 2009
Kouhei Sutou пишет:
> Because test_root can't find dc=test_domain1. (test_root and
> dc=test_domain1 has different objectClass.)
> If dc=test_domain1 isn't deleted, ou=test_child1 and
> ou=test_root can't be deleted.
> ActiveLdap::Base.search(:base => test_root.dn) can find all
> entries under test_root.dn. So ActiveLdap::Base.delete_all
> can delete all entries successfully.
> Suggested solution:
> Create Entry class and use it:
> class Entry < ActiveLdap::Base
> ldap_mapping :prefix => "",
> :classes => ["top"],
> :scope => :sub
> self.dn_attribute = nil
> entry = Entry.find(test_root.dn)
> entry.delete_all # delete_all without argument can be work with trunk.
> # or
> Entry.delete_all(:base => test_root.dn)
> See also: examples/al-admin/app/model/entry.rb
Thanks for answer.
Now I understand what I'm doing wrong :)
More information about the ruby-activeldap-discuss