diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-07-07 11:28:59 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-07-07 11:29:15 -0300 |
commit | 5fde4d47938661b77d8b58bec63d64b66c33ced9 (patch) | |
tree | 2eef391d217e76b628208a99dd960fc6cb8fceb4 /activerecord/lib | |
parent | d8ca791f48ea096d0e19bdc0ef1d021764a79f20 (diff) | |
download | rails-5fde4d47938661b77d8b58bec63d64b66c33ced9.tar.gz rails-5fde4d47938661b77d8b58bec63d64b66c33ced9.tar.bz2 rails-5fde4d47938661b77d8b58bec63d64b66c33ced9.zip |
Refactor locked? method in query cache
Introduced in 75b340d1a4bcf2f1233fb65a15ff6b8059e2230e
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb index a6e16da730..be6fda95b4 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb @@ -65,6 +65,7 @@ module ActiveRecord end private + def cache_sql(sql, binds) result = if @query_cache[sql].key?(binds) @@ -85,11 +86,7 @@ module ActiveRecord end def locked?(arel) - if arel.respond_to?(:locked) - arel.locked - else - false - end + arel.respond_to?(:locked) && arel.locked end end end |