Commit 6972c3a
authored
Use lease_connection on Rails 7.2+ in ActiveRecord5Adapter (#894)
Rails 7.2 soft-deprecated ActiveRecord::Base.connection in favour of
lease_connection, which better describes that the caller is acquiring
a connection from the pool rather than holding a permanent one (see
rails/rails#51230). Prefer lease_connection when available, and fall
back to connection on Rails < 7.2 where it is not defined.
Refs #8931 parent 1100093 commit 6972c3a
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
| |||
0 commit comments