Skip to content

Commit 501a76e

Browse files
oslivandblock
authored andcommitted
Update doc ConnectionManagement without rails
1 parent 6b31f61 commit 501a76e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- [All](#all)
2020
- [Rack](#rack)
2121
- [ActiveRecord without Rails](#activerecord-without-rails)
22+
- [Rails 4](#rails-4)
23+
- [Rails 5+](#rails-5)
2224
- [Alongside Sinatra (or other frameworks)](#alongside-sinatra-or-other-frameworks)
2325
- [Rails](#rails)
2426
- [Rails < 5.2](#rails--52)
@@ -317,13 +319,21 @@ Grape will also automatically respond to HEAD and OPTIONS for all GET, and just
317319
If you want to use ActiveRecord within Grape, you will need to make sure that ActiveRecord's connection pool
318320
is handled correctly.
319321

322+
#### Rails 4
323+
320324
The easiest way to achieve that is by using ActiveRecord's `ConnectionManagement` middleware in your
321325
`config.ru` before mounting Grape, e.g.:
322326

323327
```ruby
324328
use ActiveRecord::ConnectionAdapters::ConnectionManagement
329+
```
325330

326-
run Twitter::API
331+
#### Rails 5+
332+
333+
Use [otr-activerecord](https://github.com/jhollinger/otr-activerecord) as follows:
334+
335+
```ruby
336+
use OTR::ActiveRecord::ConnectionManagement
327337
```
328338

329339
### Alongside Sinatra (or other frameworks)

0 commit comments

Comments
 (0)