lib/active_ldap/entry_attribute.rb in activeldap-4.0.0 vs lib/active_ldap/entry_attribute.rb in activeldap-4.0.1
- old
+ new
@@ -11,11 +11,11 @@
@normalized_names = {}
@aliases = {}
@must = []
@may = []
@object_classes = []
- register(schema.attribute('objectClass'))
+ register(schema.attribute('objectClass')) if schema
object_classes.each do |objc|
# get all attributes for the class
object_class = schema.object_class(objc)
@object_classes << object_class
@must.concat(object_class.must)
@@ -52,9 +52,13 @@
return nil if @normalized_names.empty?
@normalized_names[normalize_attribute_name(name)]
else
nil
end
+ end
+
+ def exist?(name)
+ not normalize(name).nil?
end
def all_names
@names.keys + @aliases.keys
end