Included Modules

Class Index [+]

Quicksearch

ActiveLdap::Association::HasManyWrap

Private Instance Methods

delete_entries(entries) click to toggle source
    # File lib/active_ldap/association/has_many_wrap.rb, line 25
25:       def delete_entries(entries)
26:         old_value = @owner[@options[:wrap], true]
27:         _foreign_key = foreign_key
28:         if _foreign_key == "dn"
29:           old_value = dn_values_to_string_values(old_value)
30:         end
31:         current_value = entries.collect {|entry| entry[_foreign_key]}
32:         current_value = dn_values_to_string_values(current_value)
33:         new_value = old_value - current_value
34:         new_value = new_value.uniq.sort
35:         if old_value != new_value
36:           @owner[@options[:wrap]] = new_value
37:           @owner.save
38:         end
39:       end
find_target() click to toggle source
    # File lib/active_ldap/association/has_many_wrap.rb, line 41
41:       def find_target
42:         targets, requested_targets = collect_targets(@options[:wrap], true)
43:         return [] if targets.nil?
44: 
45:         found_targets = {}
46:         _foreign_key = foreign_key
47:         targets.each do |target|
48:           found_targets[target[_foreign_key]] ||= target
49:         end
50: 
51:         klass = foreign_class
52:         requested_targets.collect do |name|
53:           found_targets[name] || klass.new(name)
54:         end
55:       end
foreign_key() click to toggle source
    # File lib/active_ldap/association/has_many_wrap.rb, line 57
57:       def foreign_key
58:         @options[:primary_key_name] || foreign_class.dn_attribute
59:       end
insert_entry(entry) click to toggle source
    # File lib/active_ldap/association/has_many_wrap.rb, line 10
10:       def insert_entry(entry)
11:         old_value = @owner[@options[:wrap], true]
12:         _foreign_key = foreign_key
13:         if _foreign_key == "dn"
14:           old_value = dn_values_to_string_values(old_value)
15:         end
16:         current_value = entry[_foreign_key, true]
17:         current_value = dn_values_to_string_values(current_value)
18:         new_value = (old_value + current_value).uniq.sort
19:         if old_value != new_value
20:           @owner[@options[:wrap]] = new_value
21:           @owner.save
22:         end
23:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.