Changeset 289
- Timestamp:
- 12/16/07 17:40:27 (10 months ago)
- Files:
-
- trunk/plugin/acts_as_ferret/lib/class_methods.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugin/acts_as_ferret/lib/class_methods.rb
r288 r289 95 95 def index_dir=(dir) 96 96 logger.debug "changing index dir to #{dir}" 97 # get a handle to the index before changing the directory (which serves 98 # as the key to retrieve the index instance in aaf_index method below) 99 idx = aaf_index 97 98 # store index with the new dir as key. This prevents the aaf_index method 99 # from opening another index instance later on. 100 ActsAsFerret::ferret_indexes[dir] = aaf_index 100 101 old_dir = aaf_configuration[:index_dir] 101 102 aaf_configuration[:index_dir] = aaf_configuration[:ferret][:path] = dir 102 # store index reference with new directory103 ActsAsFerret::ferret_indexes[aaf_configuration[:index_dir]] = idx104 103 # clean old reference to index 105 104 ActsAsFerret::ferret_indexes.delete old_dir 106 idx.reopen!105 aaf_index.reopen! 107 106 logger.debug "index dir is now #{dir}" 108 107 end
