diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-27 14:53:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-27 14:53:20 -0700 |
commit | c122c7b271ef27ceb432c932855b76c2247503df (patch) | |
tree | 52fa8cf20f67a27b4e907e60d124bf0e81d55983 | |
parent | 4b536f75914fa42ebb3036fe13e08f5b0446deb2 (diff) | |
download | rails-c122c7b271ef27ceb432c932855b76c2247503df.tar.gz rails-c122c7b271ef27ceb432c932855b76c2247503df.tar.bz2 rails-c122c7b271ef27ceb432c932855b76c2247503df.zip |
stop using boolean expressions because of the side effects
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index ee138236c8..724b2e6d9c 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -102,7 +102,10 @@ module ActiveRecord # 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 |