lib/grape/app/initializers/post.rb in grape-app-0.4.0 vs lib/grape/app/initializers/post.rb in grape-app-0.4.1
- old
+ new
@@ -15,7 +15,9 @@
ActiveRecord::Base.configurations = configurations
ActiveRecord::Base.default_timezone = :utc
ActiveRecord::Base.establish_connection(Grape::App.env.to_sym)
- Grape::App.middleware.use ActiveRecord::ConnectionAdapters::ConnectionManagement
+ if defined?(ActiveRecord::ConnectionAdapters::ConnectionManagement)
+ Grape::App.middleware.use ActiveRecord::ConnectionAdapters::ConnectionManagement
+ end
end