Sha256: 2372f338f11e7da275da16b3434fe7a5807b6b9df096824e962210c6e09da1fe
Contents?: true
Size: 730 Bytes
Versions: 31
Compression:
Stored size: 730 Bytes
Contents
module Searchlogic class Search module Base def self.included(klass) klass.class_eval do attr_accessor :klass, :current_scope undef :id if respond_to?(:id) end end # Creates a new search object for the given class. Ex: # # Searchlogic::Search.new(User, {}, {:username_like => "bjohnson"}) def initialize(klass, current_scope, conditions = {}) self.klass = klass self.current_scope = current_scope @conditions ||= {} self.conditions = conditions if conditions.is_a?(Hash) end def clone self.class.new(klass, current_scope && current_scope.clone, conditions.clone) end end end end
Version data entries
31 entries across 31 versions & 4 rubygems