mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #1365 from gnufied/sqlite3
close statment only if its not closed
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user