Class: UcbOrgs::Syncer

Inherits:
Object
  • Object
show all
Defined in:
lib/ucb_orgs/syncer.rb

Overview

Syncs the org units to the LDAP tree

Since ldap is definitive and we don’t keep org history, delete any department row that wasn’t found in ldap.

Most of this code was lifted wholesale from APBears

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ldap_org_entriesObject

Returns the value of attribute ldap_org_entries.



23
24
25
# File 'lib/ucb_orgs/syncer.rb', line 23

def ldap_org_entries
  @ldap_org_entries
end

Class Method Details

.syncObject



26
27
28
# File 'lib/ucb_orgs/syncer.rb', line 26

def sync
  UcbOrgs::Syncer.new.sync
end

Instance Method Details

#syncObject



31
32
33
34
35
36
37
# File 'lib/ucb_orgs/syncer.rb', line 31

def sync
  ::UCB::LDAP::Org.root_node  # force load of whole tree
  self.ldap_org_entries = ::UCB::LDAP::Org.flattened_tree

  sync_orgs
  delete_not_found_in_ldap
end