Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor locked? method in query cache

Introduced in 75b340d
  • Loading branch information...
commit 5fde4d47938661b77d8b58bec63d64b66c33ced9 1 parent d8ca791
@carlosantoniodasilva carlosantoniodasilva authored
View
7 activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
@@ -65,6 +65,7 @@ def select_all(arel, name = nil, binds = [])
end
private
+
def cache_sql(sql, binds)
result =
if @query_cache[sql].key?(binds)
@@ -85,11 +86,7 @@ def cache_sql(sql, binds)
end
def locked?(arel)
- if arel.respond_to?(:locked)
- arel.locked
- else
- false
- end
+ arel.respond_to?(:locked) && arel.locked
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.