File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 19
19
- [ All] ( #all )
20
20
- [ Rack] ( #rack )
21
21
- [ ActiveRecord without Rails] ( #activerecord-without-rails )
22
+ - [ Rails 4] ( #rails-4 )
23
+ - [ Rails 5+] ( #rails-5 )
22
24
- [ Alongside Sinatra (or other frameworks)] ( #alongside-sinatra-or-other-frameworks )
23
25
- [ Rails] ( #rails )
24
26
- [ Rails < 5.2] ( #rails--52 )
@@ -317,13 +319,21 @@ Grape will also automatically respond to HEAD and OPTIONS for all GET, and just
317
319
If you want to use ActiveRecord within Grape, you will need to make sure that ActiveRecord's connection pool
318
320
is handled correctly.
319
321
322
+ #### Rails 4
323
+
320
324
The easiest way to achieve that is by using ActiveRecord's ` ConnectionManagement ` middleware in your
321
325
` config.ru ` before mounting Grape, e.g.:
322
326
323
327
``` ruby
324
328
use ActiveRecord ::ConnectionAdapters ::ConnectionManagement
329
+ ```
325
330
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
327
337
```
328
338
329
339
### Alongside Sinatra (or other frameworks)
You can’t perform that action at this time.
0 commit comments