vendor/gems/schof-searchlogic-0.0.2/lib/searchlogic/active_record/base.rb
# This is an alias method chain. It hook into ActiveRecord's "calculate" method and checks to see if Searchlogic should get involved.
This is an alias method chain. It hook into ActiveRecord's "calculate" method and checks to see if Searchlogic should get involved.
This is an alias method chain . It hook into ActiveRecord ' s " calculate " method and checks to see if Searchlogic should get involved .
def searchlogic_search(options = {})
          scope = {}
          current_scope = scope(:find) && scope(:find).deep_dup
          if current_scope
            [:conditions, :include, :joins].each do |option|
              value = current_scope.delete(option)
              next if value.blank?
              scope[option] = value
            end
            new_scope = {}
            current_scope.each { |k, v| new_scope[k] = v unless v.nil? }
            current_scope = new_scope
          end
          search = Searchlogic::Search::Base.create_virtual_class(self).new
          search.scope = scope
          search.options = current_scope
          search.options = options
          search
        end
def searchlogic_search ( options = { } ) scope = { } current_scope = scope ( :find ) && scope ( :find ) . deep_dup if current_scope [ :conditions , :include , :joins ] . each do | option | value = current_scope . delete ( option ) next if value . blank? scope [ option ] = value end new_scope = { } current_scope . each { | k , v | new_scope [ k ] = v unless v . nil? } current_scope = new_scope end search = Searchlogic :: Search :: Base . create_virtual_class ( self ) . new search . scope = scope search . options = current_scope search . options = options search end
This is an alias method chain.
This is an alias method chain .
# Delete nil values in the scope, for some reason habtm relationships like to pass :limit => nil
options
<not_specific>