Module: ScopedSearch::Model::ClassMethods

Defined in:
lib/scoped_search_paranoid.rb

Instance Method Summary collapse

Instance Method Details

#scoped_search(options = {}) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/scoped_search_paranoid.rb', line 49

def scoped_search(options={})
  options = (options || {}).stringify_keys
  %w(archived deleted).each do |column_name|
    if self.column_names.include?("#{column_name}_at")
      unless ::ActiveRecord::ConnectionAdapters::Column.value_to_boolean(options["with_#{column_name}"])
        options["without_#{column_name}"] = true
      end
    end
  end
  ScopedSearch::Base.new(self, options)
end