Skip to content

Commit

Permalink
Rails.root is Pathname, it's behavior is different
Browse files Browse the repository at this point in the history
in 2.2.2 acts as string in edge no :)
  • Loading branch information
kfl62 committed Feb 7, 2009
1 parent 0d126a8 commit 96b9908
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/application_controller.rb
Expand Up @@ -4,10 +4,10 @@
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time

#before_filter :current_database
before_filter :current_database

filter_parameter_logging :password, :password_confirmation
helper_method :current_trst_user_session, :current_trst_user, :current_title, :current_logo
helper_method :current_trst_user_session, :current_trst_user, :current_title, :current_logo,:current_location, :database_string


private
Expand Down Expand Up @@ -61,9 +61,9 @@ def current_location
end

def database_string
FileTest.exists?(Rails.root + '/db/' + current_location + '.sqlite3') ?
Rails.root + '/db/' + current_location + '.sqlite3' :
Rails.root + '/db/development.sqlite3'
FileTest.exists?(File.join(Rails.root,"db","#{current_location}.sqlite3")) ?
File.join(Rails.root,"db","#{current_location}.sqlite3"):
File.join(Rails.root,"db/development.sqlite3")
end

def current_database
Expand Down

0 comments on commit 96b9908

Please sign in to comment.