From f5ba175eaed740a0bc1428d1238a4d6140babbe9 Mon Sep 17 00:00:00 2001 From: jamescook Date: Sat, 13 Sep 2008 10:50:50 -0500 Subject: [PATCH] sqlite fix for current_database method --- app/helpers/application_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2ab710f..544dd3a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,7 +1,12 @@ module ApplicationHelper def current_database - ActiveRecord::Base.connection().current_database + begin + ActiveRecord::Base.connection().current_database + rescue + # Sqlite/possibly other adapters may not implement the current_database method + ActiveRecord::Base.configurations[RAILS_ENV]["database"] + end end end