Agile Web Development

Build it. Launch it. Love it.

Searcher

A simple and lightweight ‘search’ method for ActiveRecord::Base models that will search text/string-based columns for a specified critieria.

Example

  MyModel.search('some text')

You may also add normal ActiveRecord.find options, e.g.:

  MyModel.search('some text', :limit => 20)

You may specify which columns get searched in your ActiveRecord model by specifying seacher_column or seacher_columns, e.g.:

  class Foo < ActiveRecord::Base
      searcher_column :col1, :col2
  end

Copyright © 2009 Michael Behan aka Jabberwock, licensed under BSD.

Vitals

Home http://www.behanisms.com/
Repository git://github.com/jabberwock/Searcher.git
License BSD
Tags Tag_red
Rating (1 vote)
Owner Michael Behan aka Jabberwock
Created 9 June 2009

Comments

Add a comment