google-code-export / ruby-activeldap

Automatically exported from code.google.com/p/ruby-activeldap
Other
1 stars 1 forks source link

Error saving an ActiveLDAP user #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up a class (LdapUser) mapping to an inetOrgPerson
2. Use LdapUser.find("brad") to get a user
3. Set something like user.surname = "test"
4. Call user.save

What is the expected output? What do you see instead?

I would like it to save back to server without error.  Instead I am 
getting this error:

TypeError: singleton can't be dumped
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/
active_ldap/base.rb:1465:in `dump'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/
active_ldap/base.rb:1465:in `prepare_data_for_saving'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/
active_ldap/base.rb:1486:in `update_without_callbacks'
    from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/callbacks.rb:282:in `update'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/
active_ldap/base.rb:1449:in `create_or_update_without_callbacks'
    from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/callbacks.rb:250:in `create_or_update'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/
active_ldap/base.rb:778:in `save_without_valida
tion!'

What version of the product are you using? On what operating system?

Gem 1.0.9 on OS X 10.5

Please provide any additional information below.

Original issue reported on code.google.com by calendar...@gtempaccount.com on 22 Jun 2009 at 7:08

GoogleCodeExporter commented 9 years ago
I coulnd't reproduce this.
Could you show us a test data?

  puts LdapUser.find("brad")

Original comment by kou...@gmail.com on 23 Jun 2009 at 12:14

GoogleCodeExporter commented 9 years ago
I have the same problem, script/console result of rails:
 a = Mit::Entry.find(:base =>
"cn=qingtongxiazhijiaozhongxin,cn=qingtongxia,cn=wuzhong,cn=ningxia,c=cn", 
:scope =>
:sub, :filter => "(&(cn=AP2)(objectClass=top))")
=> #<Mit::Entry objectClass:<ossWirelessAccessPoint, ossIpDevice, top>, 
must:<cn, ip,
objectClass, text>, may:<availableStatus, category, comments, description,
discoverState, httpPassword, httpUser, level, location, macAddress, 
managedState,
mask, monitorPeriod, monitorState, pingStatus, priority, productionState,
serialNumber, snmpCommunity, snmpStatus, snmpWriteCommunity, ssid, sysDescr, 
sysOid,
telnetPassword, telnetUser, type, vendor, version, vlanId, zIndex>, 
availableStatus:
[true], category: [], cn: ["AP2"], comments: [], commonName: ["AP2"], 
description: ["
学生公寓、办公楼(部分)"], discoverState: ["discovered"], 
httpPassword: [],
httpUser: [], ip: ["222.75.182.50"], ipAddress: ["222.75.182.50"], level: [2],
location: ["职教中心食堂西北角"], macAddress: [], managedState: 
["managed"], mask:
["255.255.255.0"], monitorPeriod: [], monitorState: [], objectClass:
["ossWirelessAccessPoint", "ossIpDevice", "top"], pingStatus: ["OK"], priority: 
[],
productionState: [], serialNumber: [], snmpCommunity: ["public"], snmpStatus: 
["OK"],
snmpWriteCommunity: ["private"], ssid: [], sysDescr: ["WAG SNMP Agent"], sysOid:
["1.3.6.1.4.1.9442.1"], telnetPassword: [], telnetUser: [], text: 
["青铜峡职教中心
AP2"], type: [], vendor: ["unknown"], version: [], vlanId: ["1"], zIndex: []>
>> a.attributes
TypeError: singleton can't be dumped
        from
/usr/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/active_ldap/base.rb:863:i
n `dump'
        from
/usr/local/lib/ruby/gems/1.8/gems/activeldap-1.0.9/lib/active_ldap/base.rb:863:i
n
`attributes'
        from (irb):13

Original comment by ery....@gmail.com on 15 Aug 2009 at 5:48

GoogleCodeExporter commented 9 years ago
I've fixed it in trunk. Thanks.

Original comment by kou...@gmail.com on 21 Sep 2009 at 9:16