提交 994a1c2a 编写于 作者: S Santiago Pastorino

Execute less operations

上级 1f06652a
......@@ -545,8 +545,7 @@ def ensure_owner_is_not_new
def fetch_first_or_last_using_find?(args)
args.first.kind_of?(Hash) || !(loaded? || !@owner.persisted? || @reflection.options[:finder_sql] ||
@target.any? { |record| !record.persisted? } || args.first.kind_of?(Integer))
# TODO - would prefer @target.none? { |r| r.persisted? }
!@target.all? { |record| record.persisted? } || args.first.kind_of?(Integer))
end
def include_in_memory?(record)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册