提交 b9e869a4 编写于 作者: E Emilio Tagua

Query objects if readonly_value is false, skip them only if nil.

上级 024bc70b
......@@ -61,13 +61,13 @@ def respond_to?(method, include_private = false)
def to_a
return @records if loaded?
@records = if @readonly_value
IdentityMap.without do
@records = if @readonly_value.nil?
eager_loading? ? find_with_associations : @klass.find_by_sql(arel.to_sql, @bind_values)
end
else
IdentityMap.without do
eager_loading? ? find_with_associations : @klass.find_by_sql(arel.to_sql, @bind_values)
end
end
preload = @preload_values
preload += @includes_values unless eager_loading?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册