Sha256: 167dc3d9509826977a6f78edee618af85c3bbb6dbcc5d7f30c2c921421ff178d

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

module SearchCraft
  class Configuration
    attr_accessor :disable_autorebuild
    attr_accessor :debug
    attr_reader :explicit_builder_classes
    attr_accessor :explicit_builder_class_names
    attr_accessor :explicit_model_class_names
    attr_reader :view_hash_store_table_name

    def autorebuild?
      !disable_autorebuild
    end

    # If you need to explicitly list the builder + model classes you want to use,
    # then set this to a hash of builder class names => model class names.
    # {
    #   "Search::Builder::ContentArticleSearchBuilder" => "Search::ContentArticleSearch",
    #   "Search::Builder::ContentPageSearchBuilder" => "Search::ContentPageSearch"
    # }
    def explicit_builder_classes=(builders_and_models)
      @explicit_builder_classes = builders_and_models
      @explicit_builder_class_names = builders_and_models.keys
      @explicit_model_class_names = builders_and_models.values
    end

    def view_hash_store_table_name=(table_name)
      @view_hash_store_table_name = table_name
      SearchCraft::ViewHashStore.table_name = table_name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
searchcraft-0.4.1 lib/searchcraft/configuration.rb