新手问题 ActiveRecord 5.0.0 removes the ConnectionManagement 之后 你们是怎么使用这块的?

JSmile · June 08, 2017 · Last by JSmile replied at June 14, 2017 · 1384 hits

这几天想用 grape 做接口这部分时候,遇到个问题,在最新版的里,想用 ActiveRecord 管理数据库链接

use ActiveRecord::ConnectionAdapters::ConnectionManagement

结果发现:

ERROR -- : uninitialized constant ActiveRecord::ConnectionAdapters::ConnectionManagement (NameError)

我查了下资料, 这里 发现了问题

Active record 5.0.0 removes the ConnectionManagement class

对于新版的 5.1.1 你们这块是怎么解决的?

除了

gem 'activerecord', '< 5.0.0', :require => 'active_record'

还有其他的解决方式吗?或者另外一种解决方案也可以

You need to Sign in before reply, if you don't have an account, please Sign up first.