Merge pull request #1365 from gnufied/sqlite3

close statment only if its not closed
This commit is contained in:
Aaron Patterson
2011-05-27 14:40:32 -07:00
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -12,7 +12,7 @@ module ActiveRecord
# These are explicitly delegated to improve performance (avoids method_missing)
delegate :to_xml, :to_yaml, :length, :collect, :map, :each, :all?, :include?, :to => :to_a
delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key, :to => :klass
delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key, :connection, :column_hash,:to => :klass
attr_reader :table, :klass, :loaded
attr_accessor :extensions, :default_scoped