Sha256: ef7230e8e1a5dc51c326a8427f92240420b986049319e3a6361dbfcf64be691c

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

require 'active_record'

require 'acts_as_indexed/class_methods'
require 'acts_as_indexed/instance_methods'
require 'acts_as_indexed/singleton_methods'
require 'acts_as_indexed/configuration'
require 'acts_as_indexed/search_index'
require 'acts_as_indexed/search_atom'
require 'acts_as_indexed/storage'
require 'acts_as_indexed/pre_tokenizer'
require 'acts_as_indexed/tokenizer'
require 'acts_as_indexed/token_normalizer'

if defined?(WillPaginate)
  require 'will_paginate_search'
end

module ActsAsIndexed #:nodoc:

  # This is the last version of the plugin where the index structure was
  # changed in some manner. Is only changed when necessary, not every release.
  INDEX_VERSION = '0.6.8'

  # Holds the default configuration for acts_as_indexed.

  @configuration = Configuration.new

  # Returns the current configuration for acts_as_indexed.

  def self.configuration
    @configuration
  end

  # Call this method to modify defaults in your initializers.
  #
  # Example showing some defaults:
  #   ActsAsIndexed.configure do |config|
  #     config.index_file = [Rails.root,'index']
  #     config.index_file_depth = 3
  #     config.min_word_size = 3
  #   end

  def self.configure
    self.configuration ||= Configuration.new
    yield(configuration)
  end

  def self.included(mod)
    mod.extend(ClassMethods)
  end

end

# reopen ActiveRecord and include all the above to make
# them available to all our models if they want it

ActiveRecord::Base.class_eval do
  include ActsAsIndexed
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acts_as_indexed-0.8.3 lib/acts_as_indexed.rb
acts_as_indexed-0.8.2 lib/acts_as_indexed.rb
acts_as_indexed-0.8.1 lib/acts_as_indexed.rb
acts_as_indexed-0.8.0 lib/acts_as_indexed.rb