aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/deploy.rb2
-rw-r--r--config/initializers/acts_as_xapian.rb25
2 files changed, 26 insertions, 1 deletions
diff --git a/config/deploy.rb b/config/deploy.rb
index 8ab67bc98..a0189c855 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -58,7 +58,7 @@ namespace :deploy do
"#{release_path}/public/favicon.ico" => "#{shared_path}/favicon.ico",
"#{release_path}/files" => "#{shared_path}/files",
"#{release_path}/cache" => "#{shared_path}/cache",
- "#{release_path}/vendor/plugins/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs",
+ "#{release_path}/lib/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs",
}
# "ln -sf <a> <b>" creates a symbolic link but deletes <b> if it already exists
diff --git a/config/initializers/acts_as_xapian.rb b/config/initializers/acts_as_xapian.rb
new file mode 100644
index 000000000..f82193c85
--- /dev/null
+++ b/config/initializers/acts_as_xapian.rb
@@ -0,0 +1,25 @@
+# acts_as_xapian/init.rb:
+#
+# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
+# Email: hello@mysociety.org; WWW: http://www.mysociety.org/
+
+# We're moving plugins out of vendor/plugins, since keeping them there
+# is deprecated as of Rails 3.2, and the xapiandbs directory should be
+# moved out of there along with the plugin itself.
+
+old_xapiandbs_path = Rails.root.join('vendor',
+ 'plugins',
+ 'acts_as_xapian',
+ 'xapiandbs')
+
+current_xapiandbs_path = Rails.root.join('lib',
+ 'acts_as_xapian',
+ 'xapiandbs')
+
+if File.exists? old_xapiandbs_path
+ unless File.exists? current_xapiandbs_path
+ File.rename old_xapiandbs_path, current_xapiandbs_path
+ end
+end
+
+require 'acts_as_xapian/acts_as_xapian'