Fixes #1915. Only clear the connection pool if it exists
git-svn-id: file:///home/svn/framework3/trunk@9301 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
f440317225
commit
10364dc70d
|
@ -26,12 +26,12 @@ module DBSave
|
|||
def self.included(mod)
|
||||
class << mod
|
||||
def find(*args)
|
||||
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
|
||||
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
|
||||
super(*args)
|
||||
end
|
||||
|
||||
def save(*args)
|
||||
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
|
||||
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
|
||||
super(*args)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue