diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 2 |
1 files changed, 1 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 8e7c936bf8..ee138236c8 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -102,7 +102,7 @@ module ActiveRecord # Clears the prepared statements cache. def clear_cache! - @statements.values.each { |hash| hash[:stmt].close } + @statements.values.each { |hash| !hash[:stmt].closed? && hash[:stmt].close } @statements.clear end |