提交 49f3525f 编写于 作者: E Emilio Tagua

Initialize @target instead asking if it is defined.

上级 eb23b224
......@@ -24,6 +24,7 @@ class Association #:nodoc:
def initialize(owner, reflection)
reflection.check_validity!
@target = nil
@owner, @reflection = owner, reflection
@updated = false
......@@ -42,7 +43,7 @@ def aliased_table_name
# Resets the \loaded flag to +false+ and sets the \target to +nil+.
def reset
@loaded = false
IdentityMap.remove(@target) if defined?(@target) && @target && IdentityMap.enabled?
IdentityMap.remove(@target) if IdentityMap.enabled? && @target
@target = nil
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册