Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

not overriding already set keys while create

  • Loading branch information...
commit fdffa16324ccd46e70ecb46a1d008c0a18bd328e 1 parent 32f4447
@krissi authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/adapters/ldap_adapter.rb
View
12 lib/adapters/ldap_adapter.rb
@@ -215,10 +215,14 @@ def create_resource(resource)
key = prop if prop.serial?
end
resource_dup = resource.dup
- id = ldap.retrieve_next_id(resource.model.treebase,
- key_properties(resource).field)
- resource_dup.send("#{key_properties(resource).name}=".to_sym, id)
- props[key_properties(resource).field.to_sym] = "#{id}"
+
+ if props[key_properties(resource).field.to_sym].nil? then
+ id = ldap.retrieve_next_id(resource.model.treebase,
+ key_properties(resource).field)
+ resource_dup.send("#{key_properties(resource).name}=".to_sym, id)
+ props[key_properties(resource).field.to_sym] = "#{id}"
+ end
+
key_value = begin
ldap.create_object(resource.model.dn_prefix(resource_dup),
resource.model.treebase,
Please sign in to comment.
Something went wrong with that request. Please try again.