class ActiveLdap::Association::BelongsTo

Public Instance Methods

replace(entry) click to toggle source
# File lib/active_ldap/association/belongs_to.rb, line 6
def replace(entry)
  if entry.nil?
    @target = @owner[@options[:foreign_key_name]] = nil
  else
    @target = (Proxy === entry ? entry.target : entry)
    infect_connection(@target)
    unless entry.new_entry?
      @owner[@options[:foreign_key_name]] = entry[primary_key]
    end
    @updated = true
  end

  loaded
  entry
end
updated?() click to toggle source
# File lib/active_ldap/association/belongs_to.rb, line 22
def updated?
  @updated
end