Class Index [+]

Quicksearch

ActiveLdap::Association::BelongsTo

Public Instance Methods

replace(entry) click to toggle source
    # File lib/active_ldap/association/belongs_to.rb, line 6
 6:       def replace(entry)
 7:         if entry.nil?
 8:           @target = @owner[@options[:foreign_key_name]] = nil
 9:         else
10:           @target = (Proxy === entry ? entry.target : entry)
11:           infect_connection(@target)
12:           unless entry.new_entry?
13:             @owner[@options[:foreign_key_name]] = entry[primary_key]
14:           end
15:           @updated = true
16:         end
17: 
18:         loaded
19:         entry
20:       end
updated?() click to toggle source
    # File lib/active_ldap/association/belongs_to.rb, line 22
22:       def updated?
23:         @updated
24:       end

Private Instance Methods

find_target() click to toggle source
    # File lib/active_ldap/association/belongs_to.rb, line 31
31:       def find_target
32:         value = @owner[@options[:foreign_key_name]]
33:         raise EntryNotFound if value.nil?
34:         key = primary_key
35:         if key == "dn"
36:           result = foreign_class.find(value, find_options)
37:         else
38:           filter = {key => value}
39:           options = find_options(:filter => filter, :limit => 1)
40:           result = foreign_class.find(:all, options).first
41:         end
42:         raise EntryNotFound if result.nil?
43:         result
44:       end
have_foreign_key?() click to toggle source
    # File lib/active_ldap/association/belongs_to.rb, line 27
27:       def have_foreign_key?
28:         not @owner[@options[:foreign_key_name]].nil?
29:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.