lib/scoped_search.rb in scoped_search-2.2.1 vs lib/scoped_search.rb in scoped_search-2.3.0

- old
+ new

@@ -1,5 +1,7 @@ +require 'active_record' + # ScopedSearch is the base module for the scoped_search plugin. This file # defines some modules and exception classes, loads the necessary files, and # installs itself in ActiveRecord. # # The ScopedSearch module defines two modules that can be mixed into @@ -10,11 +12,11 @@ # previous scoped_search versions (1.x). module ScopedSearch # The current scoped_search version. Do not change thisvalue by hand, # because it will be updated automatically by the gem release script. - VERSION = "2.2.1" + VERSION = "2.3.0" # The ClassMethods module will be included into the ActiveRecord::Base class # to add the <tt>ActiveRecord::Base.scoped_search</tt> method and the # <tt>ActiveRecord::Base.search_for</tt> named scope. module ClassMethods @@ -83,9 +85,15 @@ # Load all lib files require 'scoped_search/definition' require 'scoped_search/query_language' require 'scoped_search/query_builder' +require 'scoped_search/auto_complete_builder' # Import the search_on method in the ActiveReocrd::Base class ActiveRecord::Base.send(:extend, ScopedSearch::ClassMethods) ActiveRecord::Base.send(:extend, ScopedSearch::BackwardsCompatibility) + +if defined?(ActionController) + require "scoped_search/rails_helper" + ActionController::Base.helper(ScopedSearch::RailsHelper) +end