diff --git a/CHANGELOG b/CHANGELOG index a8ff6d1..2422212 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* adding Xapit::Config#reload_database method + *0.2.1* (June 15th, 2009) * including Xapit::Membership into ActiveRecord when using gem diff --git a/README.rdoc b/README.rdoc index 0f31d8c..69b32a5 100644 --- a/README.rdoc +++ b/README.rdoc @@ -77,8 +77,8 @@ You may want to trigger this via a cron job on a recurring schedule (i.e. every There are two projects in development to help improve this reindexing. -http://github.com/ryanb/xapit-sync/tree/master -http://github.com/ryanb/xapit-server/tree/master +* http://github.com/ryanb/xapit-sync/tree/master +* http://github.com/ryanb/xapit-server/tree/master == Search diff --git a/lib/xapit/config.rb b/lib/xapit/config.rb index 54bc46b..4ca935d 100644 --- a/lib/xapit/config.rb +++ b/lib/xapit/config.rb @@ -67,6 +67,12 @@ def writable_database # Removes the configured database file and clears the stored one in memory. def remove_database # this can be a bit dangers, maybe do some checking here first? FileUtils.rm_rf(path) if File.exist? path + reload_database + end + + # Clear the current database from memory to fetch it again (upon request). + # Note: It is best to only use this on a readable database. + def reload_database @database = nil @writable_database = nil end