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)
|
def self.included(mod)
|
||||||
class << mod
|
class << mod
|
||||||
def find(*args)
|
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)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def save(*args)
|
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)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue