提交 c9b685e6 编写于 作者: J Jon Leighton

@target should always be an array

上级 db033084
......@@ -354,12 +354,13 @@ def load_target
def add_to_target(record)
callback(:before_add, record)
yield(record) if block_given?
@target ||= [] unless loaded?
if @reflection.options[:uniq] && index = @target.index(record)
@target[index] = record
else
@target << record
end
callback(:after_add, record)
set_inverse_instance(record)
record
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册