Sha256: 55f59622d9726b5bfc9efdf96a7f842b9230e99324ea9d020da2bab862cc8400

Contents?: true

Size: 481 Bytes

Versions: 13

Compression:

Stored size: 481 Bytes

Contents

module Calagator

class Event < ActiveRecord::Base
  class SearchEngine
    cattr_accessor(:kind) { :sql }

    def self.search(*args)
      search_engine.search(*args)
    end

    def self.use(kind)
      self.kind = kind
      search_engine.configure if search_engine.respond_to?(:configure)
    end

    def self.score?
      search_engine.score?
    end

    private_class_method

    def self.search_engine
      kind == :sunspot ? ApacheSunspot : Sql
    end
  end
end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
calagator-1.0.0 app/models/calagator/event/search_engine.rb
grokus-1.0.0.9 app/models/calagator/event/search_engine.rb
grokus-1.0.0.8 app/models/calagator/event/search_engine.rb
grokus-1.0.0.7 app/models/calagator/event/search_engine.rb
grokus-1.0.0.6 app/models/calagator/event/search_engine.rb
grokus-1.0.0.5 app/models/calagator/event/search_engine.rb
grokus-1.0.0.3 app/models/calagator/event/search_engine.rb
grokus-1.0.0.2 app/models/calagator/event/search_engine.rb
grokus-1.0.0.1 app/models/calagator/event/search_engine.rb
calagator-1.0.0.rc3 app/models/calagator/event/search_engine.rb
calagator-1.0.0.rc2 app/models/calagator/event/search_engine.rb
calagator-1.0.0.rc1 app/models/calagator/event/search_engine.rb
calagator-0.0.1.pre1 app/models/calagator/event/search_engine.rb