mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
expire will set in_use to false
This commit is contained in:
@@ -69,6 +69,7 @@ module ActiveRecord
|
||||
@visitor = nil
|
||||
@schema_cache = SchemaCache.new self
|
||||
@in_use = false
|
||||
@last_use = false
|
||||
end
|
||||
|
||||
def lease
|
||||
@@ -80,6 +81,10 @@ module ActiveRecord
|
||||
end
|
||||
end
|
||||
|
||||
def expire
|
||||
@in_use = false
|
||||
end
|
||||
|
||||
# Returns the human-readable name of the adapter. Use mixed case - one
|
||||
# can always use downcase if needed.
|
||||
def adapter_name
|
||||
|
||||
@@ -26,6 +26,13 @@ module ActiveRecord
|
||||
adapter.lease
|
||||
assert adapter.last_use
|
||||
end
|
||||
|
||||
def test_expire_mutates_in_use
|
||||
assert adapter.lease, 'lease adapter'
|
||||
assert adapter.in_use?, 'adapter is in use'
|
||||
adapter.expire
|
||||
assert !adapter.in_use?, 'adapter is in use'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user