Sha256: 985aec11415445fbb2401b5d8971668b989feb99d9f58f7a0fcdf2a30f639118

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

require "searchlogic/core_ext/proc"
require "searchlogic/core_ext/object"
require "searchlogic/active_record_consistency"
require "searchlogic/named_scopes/conditions"
require "searchlogic/named_scopes/ordering"
require "searchlogic/named_scopes/associations"
require "searchlogic/named_scopes/alias_scope"
require "searchlogic/search"

Proc.send(:include, Searchlogic::CoreExt::Proc)
Object.send(:include, Searchlogic::CoreExt::Object)
ActiveRecord::Base.extend(Searchlogic::NamedScopes::Conditions)
ActiveRecord::Base.extend(Searchlogic::NamedScopes::Ordering)
ActiveRecord::Base.extend(Searchlogic::NamedScopes::Associations)
ActiveRecord::Base.extend(Searchlogic::NamedScopes::AliasScope)
ActiveRecord::Base.extend(Searchlogic::Search::Implementation)

# Try to use the search method, if it's available. Thinking sphinx and other plugins
# like to use that method as well.
if !ActiveRecord::Base.respond_to?(:search)
  ActiveRecord::Base.class_eval do
    class << self
      alias_method :search, :searchlogic
    end
  end
end

if defined?(ActionController)
  require "searchlogic/rails_helpers"
  ActionController::Base.helper(Searchlogic::RailsHelpers)
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
binarylogic-searchlogic-2.1.4 lib/searchlogic.rb
binarylogic-searchlogic-2.1.5 lib/searchlogic.rb
joost-searchlogic-2.1.5.2 lib/searchlogic.rb
searchlogic-2.1.4 lib/searchlogic.rb
searchlogic-2.1.5 lib/searchlogic.rb