To edit pages or tickets please login with username/password: aaf/aaf

Changeset 289

Show
Ignore:
Timestamp:
12/16/07 17:40:27 (10 months ago)
Author:
jk
Message:

cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plugin/acts_as_ferret/lib/class_methods.rb

    r288 r289  
    9595    def index_dir=(dir) 
    9696      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 
    100101      old_dir = aaf_configuration[:index_dir] 
    101102      aaf_configuration[:index_dir] = aaf_configuration[:ferret][:path] = dir 
    102       # store index reference with new directory 
    103       ActsAsFerret::ferret_indexes[aaf_configuration[:index_dir]] = idx 
    104103      # clean old reference to index 
    105104      ActsAsFerret::ferret_indexes.delete old_dir 
    106       idx.reopen! 
     105      aaf_index.reopen! 
    107106      logger.debug "index dir is now #{dir}" 
    108107    end 

To edit pages or tickets please login with username/password: aaf/aaf