Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit b9e869a420d0ae0a94446df012c215aefa58487b 1 parent 024bc70
@miloops miloops authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/relation.rb
View
6 activerecord/lib/active_record/relation.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.