Skip to content

Commit

Permalink
Query objects if readonly_value is false, skip them only if nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
miloops committed Nov 19, 2010
1 parent 024bc70 commit b9e869a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord/lib/active_record/relation.rb
Expand Up @@ -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
Expand Down

0 comments on commit b9e869a

Please sign in to comment.