Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sync_ldap_attrs
- ldap_attrs = LDAP_MAPPING.inject({}) do |attrs, (key, value)|
- attrs[key] = self.send(value)
- attrs
- end
- ldap_attrs[:comment] = [self.comment, self.notes].compact.join("\n")
- ldap_attrs[:contact_type] = contact_type.name
- ldap_record.update(ldap_attrs)
- if ldap_record.changed?
- raise ActiveRecord::Rollback unless ldap_record.save
- end
- end
- def ldap_record
- @ldap_record ||= (new_record? ? TransisDS::Person.new : TransisDS::Person.fetch_by_uid(self.ldap_uid))
- end
Add Comment
Please, Sign In to add comment