Skip to content

Commit

Permalink
Uses the public #select_all instead of private #select
Browse files Browse the repository at this point in the history
  • Loading branch information
mezis committed Mar 18, 2016
1 parent 6825145 commit 5ae767c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/record_cache/datastore/active_record_30.rb
Expand Up @@ -35,7 +35,7 @@ def find_by_sql_with_record_cache(sql)
records = if connection.query_cache_enabled
connection.query_cache["rc/#{sanitized_sql}"] ||= try_record_cache(sanitized_sql, arel)
elsif connection.open_transactions > RC_TRANSACTIONS_THRESHOLD
connection.send(:select, sanitized_sql, "#{name} Load")
connection.select_all(sanitized_sql, "#{name} Load")
else
try_record_cache(sanitized_sql, arel)
end
Expand All @@ -46,7 +46,7 @@ def find_by_sql_with_record_cache(sql)
def try_record_cache(sql, arel)
query = arel && arel.respond_to?(:ast) ? RecordCache::Arel::QueryVisitor.new.accept(arel.ast) : nil
record_cache.fetch(query) do
connection.send(:select, sql, "#{name} Load")
connection.select_all(sql, "#{name} Load")
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/record_cache/datastore/active_record_31.rb
Expand Up @@ -38,7 +38,7 @@ def find_by_sql_with_record_cache(sql, binds = [])
records = if connection.query_cache_enabled
connection.query_cache["rc/#{sanitized_sql}"][binds] ||= try_record_cache(arel, sanitized_sql, binds)
elsif connection.open_transactions > RC_TRANSACTIONS_THRESHOLD
connection.send(:select, sanitized_sql, "#{name} Load", binds)
connection.select_all(sanitized_sql, "#{name} Load", binds)
else
try_record_cache(arel, sanitized_sql, binds)
end
Expand All @@ -49,7 +49,7 @@ def find_by_sql_with_record_cache(sql, binds = [])
def try_record_cache(arel, sql, binds)
query = arel && arel.respond_to?(:ast) ? RecordCache::Arel::QueryVisitor.new(binds).accept(arel.ast) : nil
record_cache.fetch(query) do
connection.send(:select, sql, "#{name} Load", binds)
connection.select_all(sql, "#{name} Load", binds)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/record_cache/datastore/active_record_32.rb
Expand Up @@ -38,7 +38,7 @@ def find_by_sql_with_record_cache(sql, binds = [])
records = if connection.query_cache_enabled
connection.query_cache["rc/#{sanitized_sql}"][binds] ||= try_record_cache(arel, sanitized_sql, binds)
elsif connection.open_transactions > RC_TRANSACTIONS_THRESHOLD
connection.send(:select, sanitized_sql, "#{name} Load", binds)
connection.select_all(sanitized_sql, "#{name} Load", binds)
else
try_record_cache(arel, sanitized_sql, binds)
end
Expand All @@ -50,7 +50,7 @@ def find_by_sql_with_record_cache(sql, binds = [])
def try_record_cache(arel, sql, binds)
query = arel && arel.respond_to?(:ast) ? RecordCache::Arel::QueryVisitor.new(binds).accept(arel.ast) : nil
record_cache.fetch(query) do
connection.send(:select, sql, "#{name} Load", binds)
connection.select_all(sql, "#{name} Load", binds)
end
end

Expand Down

0 comments on commit 5ae767c

Please sign in to comment.