Created
February 24, 2011 23:06
-
-
Save javierv/843084 to your computer and use it in GitHub Desktop.
Fix for the test database in XapianDb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/xapian_db/railtie.rb b/lib/xapian_db/railtie.rb | |
index 9a9e3d8..926ea19 100644 | |
--- a/lib/xapian_db/railtie.rb | |
+++ b/lib/xapian_db/railtie.rb | |
@@ -21,13 +21,13 @@ module XapianDb | |
if File.exist?(config_file_path) | |
db_config = YAML::load_file config_file_path | |
env_config = db_config[Rails.env] | |
- database_path = File.expand_path(env_config["database"]) || ":memory:" | |
+ database_path = env_config["database"] || ":memory:" | |
adapter = env_config["adapter"] || :active_record | |
writer = env_config["writer"] || :direct | |
beanstalk_daemon = env_config["beanstalk_daemon"] | |
else | |
# No config file, set the defaults | |
- Rails.env == "test" ? database_path = ":memory:" : database_path = File.expand_path("db/xapian_db/#{Rails.env}") | |
+ Rails.env == "test" ? database_path = ":memory:" : database_path = "db/xapian_db/#{Rails.env}" | |
adapter = :active_record | |
writer = :direct | |
beanstalk_daemon = nil | |
@@ -38,7 +38,7 @@ module XapianDb | |
if database_path == ":memory:" | |
config.database :memory | |
else | |
- config.database database_path | |
+ config.database File.expand_path(database_path) | |
end | |
config.adapter adapter.to_sym | |
config.writer writer.to_sym |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment