diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-12 21:46:40 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-12 21:46:40 +0000 |
commit | 9ab3cf355db5b8b6c558aea4744c2803fa658176 (patch) | |
tree | c4e727d51564f9af9859b10eaecec2a3ea479426 | |
parent | a7b84a5073df36d6044668c716d65b7c01995a0c (diff) | |
parent | 7c45a7297345e26e02010a554ecc189132e07c10 (diff) |
Merge branch 'release/0.5' into develop
-rw-r--r-- | app/models/info_request.rb | 1 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb | 17 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake | 1 |
3 files changed, 11 insertions, 8 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index a0652ecd8..b5a1cd833 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -21,7 +21,6 @@ require 'digest/sha1' -require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian') class InfoRequest < ActiveRecord::Base strip_attributes! diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb index c086c8125..1c7ff97b0 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb @@ -30,14 +30,19 @@ module ActsAsXapian class NoXapianRubyBindingsError < StandardError end - # XXX global class intializers here get loaded more than once, don't know why. Protect them. - if not $acts_as_xapian_class_var_init - @@db = nil - @@db_path = nil - @@writable_db = nil - @@init_values = [] + @@db = nil + @@db_path = nil + @@writable_db = nil + @@init_values = [] + + # There used to be a problem with this module being loaded more than once. + # Keep a check here, so we can tell if the problem recurs. + if $acts_as_xapian_class_var_init + raise "The acts_as_xapian module has already been loaded" + else $acts_as_xapian_class_var_init = true end + def ActsAsXapian.db @@db end diff --git a/vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake b/vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake index 470016420..c1986ce1e 100644 --- a/vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake +++ b/vendor/plugins/acts_as_xapian/lib/tasks/xapian.rake @@ -2,7 +2,6 @@ require 'rubygems' require 'rake' require 'rake/testtask' require 'active_record' -require File.dirname(__FILE__) + '/../acts_as_xapian.rb' namespace :xapian do # Parameters - specify "flush=true" to save changes to the Xapian database |