activeldap/activeldap — Issue #38: Strange Errors When Using .add_class Method
Author: mklappstuhl
Created: 2012-03-07 22:14:08+00:00
State: open

I want to add a schema-class to every existing user.

#### This works

> a = User.find('name')
> a.add_class('classname')
> a.save
=> true

#### This does not

> User.all.each{ |u|
> u.add_class('classname')
> u.save
> }
=> ActiveLdap::LdapError::InvalidSyntax: Invalid syntax
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/ldap_ext.rb:102:in `assert_error_code'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/ldap.rb:181:in `rescue in execute'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/ldap.rb:177:in `execute'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/ldap.rb:148:in `block in modify'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/base.rb:224:in `block in modify'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/base.rb:271:in `block in operation'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/ldap.rb:187:in `do_in_timeout'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/base.rb:317:in `with_timeout'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/base.rb:270:in `operation'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/base.rb:222:in `modify'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/adapter/ldap.rb:140:in `modify'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/operations.rb:560:in `modify_entry'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/persistence.rb:58:in `block in update'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/base.rb:1516:in `prepare_data_for_saving'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/persistence.rb:56:in `update'
... 3 levels...
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/callbacks.rb:68:in `update'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/persistence.rb:43:in `create_or_update'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/callbacks.rb:60:in `block in create_or_update'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:399:in `_run_save_callbacks'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/callbacks.rb:60:in `create_or_update'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/persistence.rb:33:in `save'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activeldap-3.1.1/lib/active_ldap/validations.rb:44:in `save'
from (irb):18:in `block in irb_binding'
from (irb):15:in `each'
from (irb):15
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
from /home/martin/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:40:in `'
from script/rails:6:in `require'

**Any ideas why?**