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

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

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