Method: IdentityCache::Cached::Reference::HasOne#clear

Defined in:
lib/identity_cache/cached/reference/has_one.rb

#clear(record) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/identity_cache/cached/reference/has_one.rb', line 45

def clear(record)
  [id_variable_name, records_variable_name].each do |ivar|
    if record.instance_variable_defined?(ivar)
      record.remove_instance_variable(ivar)
    end
  end
end