From d4a11cd923be7bb9bac63ae0de69a767a97fe63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janko=20Marohni=C4=87?= Date: Wed, 26 Jun 2013 12:00:08 +0200 Subject: [PATCH] Allow ActiveRecord 4 Fixes #10 --- lib/sinatra/activerecord.rb | 2 +- sinatra-activerecord.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sinatra/activerecord.rb b/lib/sinatra/activerecord.rb index dc086ae..e9f1ad4 100644 --- a/lib/sinatra/activerecord.rb +++ b/lib/sinatra/activerecord.rb @@ -52,7 +52,7 @@ def self.registered(app) app.helpers ActiveRecordHelper # re-connect if database connection dropped - app.before { ActiveRecord::Base.verify_active_connections! } + app.before { ActiveRecord::Base.verify_active_connections! if ActiveRecord::Base.respond_to?(:verify_active_connections!) } app.after { ActiveRecord::Base.clear_active_connections! } end diff --git a/sinatra-activerecord.gemspec b/sinatra-activerecord.gemspec index aab0399..dbb0223 100644 --- a/sinatra-activerecord.gemspec +++ b/sinatra-activerecord.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 1.9.2" gem.add_dependency "sinatra", "~> 1.0" - gem.add_dependency "activerecord", "~> 3.0" + gem.add_dependency "activerecord", ">= 3.0" gem.add_development_dependency "rake" gem.add_development_dependency "rspec", ">= 2.10"