Skip to content
Browse files

stop using boolean expressions because of the side effects

  • Loading branch information...
1 parent 4b536f7 commit c122c7b271ef27ceb432c932855b76c2247503df @tenderlove tenderlove committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
View
5 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -102,7 +102,10 @@ def disconnect!
# Clears the prepared statements cache.
def clear_cache!
- @statements.values.each { |hash| !hash[:stmt].closed? && hash[:stmt].close }
+ @statements.values.map { |hash| hash[:stmt] }.each { |stmt|
+ stmt.close unless stmt.closed?
+ }
+
@statements.clear
end

0 comments on commit c122c7b

Please sign in to comment.
Something went wrong with that request. Please try again.