Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
sqlite fix for current_database method
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescook committed Sep 13, 2008
1 parent 664e907 commit f5ba175
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 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

0 comments on commit f5ba175

Please sign in to comment.