google-code-export / ruby-activeldap

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

Raised when RDN - blank (DistinguishedNameNotSetError) #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install ActiveLdap from trunk (r830)
2. Generate model (org_unit.rb)
class OrgUnit < ActiveLdap::Base
  ldap_mapping :dn_attribute => "ou", :prefix => "", :classes =>
['organizationalUnit']
end
3. # script/console
 Loading production environment (Rails 2.2.2)
>> OrgUnit.create

What is the expected output? What do you see instead?
Must return false and add error ("ou" => "can't be blank") but raised:

---
SASL/GSSAPI authentication started
SASL username: onm@__.__.com
SASL SSF: 56
SASL data security layer installed.
ActiveLdap::DistinguishedNameNotSetError: #<OrgUnit
objectClass:<organizationalUnit>, must:<objectClass, ou>,
may:<businessCategory, description, destinationIndicator,
facsimileTelephoneNumber, internationaliSDNNumber, l,
physicalDeliveryOfficeName, postOfficeBox, postalAddress, postalCode,
preferredDeliveryMethod, registeredAddress, searchGuide, seeAlso, st,
street, telephoneNumber, teletexTerminalIdentifier, telexNumber,
userPassword, x121Address>, businessCategory: [], description: [],
destinationIndicator: [], facsimileTelephoneNumber: [], fax: [],
internationaliSDNNumber: [], l: [], localityName: [], objectClass:
["organizationalUnit"], organizationalUnitName: [], ou: [],
physicalDeliveryOfficeName: [], postOfficeBox: [], postalAddress: [],
postalCode: [], preferredDeliveryMethod: [], registeredAddress: [],
searchGuide: [], seeAlso: [], st: [], stateOrProvinceName: [], street: [],
streetAddress: [], telephoneNumber: [], teletexTerminalIdentifier: [],
telexNumber: [], userPassword: [], x121Address: []>'s DN attribute (ou)
isn't set

from /var/onm/vendor/activeldap-trunk/lib/active_ldapbase.rb:1293:in
`compute_dn'
from /var/onm/vendor/activeldap-trunk/lib/active_ldap/base.rb:691:in `dn'
from /var/onm/vendor/activeldap-trunk/lib/active_ldap/validations.rb:93:in
`validate_dn'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
178:in
`send'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
178:in
`evaluate_method'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
166:in
`call'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
90:in
`run'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
90:in
`each'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
90:in
`send'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
90:in
`run'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:
277:in
`run_validations_without_active_ldap_support'
from /var/onm/vendor/activeldap-trunk/lib/active_ldap/validations.rb:62:in
`run_callbacks'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:
1029:in
`valid_without_callbacks?'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:28
6:in
`valid?'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:
1008:in
`save'
from /var/onm/vendor/activeldap-trunk/lib/active_ldap/base.rb:355:in `create'
from (irb):1>>

---

Original issue reported on code.google.com by Alexey.Chebotar@gmail.com on 16 Feb 2009 at 4:14

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

Original comment by kou...@gmail.com on 17 Feb 2009 at 1:56