mkristian / dm-ldap-adapter

ldap-adapter for datamapper
MIT License
19 stars 3 forks source link

#save always return true #12

Open krissi opened 13 years ago

krissi commented 13 years ago

Hi,

I have written the following code: ldap_connect "uid=testuser,ou=People,o=somewhere", "mypass" u = User.first(:uid => "otheruser") u.password = "foo" p u.save

u.save in the last line prints true, but logs the warning WARN -- Ldap::NetLdapFacade: (Ldap::NetLdapFacade) update error: (50) Insufficient Access Rights DN: uid=otheruser,ou=People,o=somewhere [[:add, :userPassword, "foo"]]

I expected to get false as described in http://rubydoc.info/github/datamapper/dm-core/master/DataMapper/Resource:save. Unfortunately returning 0 in LdapAdapter.update is not enough