public
Description: Plugin adding simple searching to ActiveRecord models
Homepage:
Clone URL: git://github.com/joshuaclayton/acts_as_searchable.git
name age message
file .gitignore Loading commit data...
file MIT-LICENSE
file README
file Rakefile Mon Feb 18 19:56:05 -0800 2008 Initial import git-svn-id: http://jdclayton.c... [jclayton]
file init.rb
directory lib/ Wed Mar 11 08:30:15 -0700 2009 Allow asterisks as wildcards (by default) [joshuaclayton]
directory tasks/ Mon Feb 18 19:56:05 -0800 2008 Initial import git-svn-id: http://jdclayton.c... [jclayton]
directory test/ Mon Feb 18 19:56:05 -0800 2008 Initial import git-svn-id: http://jdclayton.c... [jclayton]
README
ActsAsSearchable
================

ActsAsSearchable provides a simple way to search upon a model.  It uses named_scope if available; otherwise, it will 
accept a block or return find(:all) with applicable conditions applied


Example
=======

class Entry < ActiveRecord::Base
  acts_as_searchable :on => [:title, :body, "comments.body", "CONCAT(users.first_name, ' ', users.last_name)", 
  "users.login"], :include => [:comments, :user]
  
  belongs_to :user
  has_many :comments
end

# within console
Entry.search('Josh Clayton') #=> [<Entry>, <Entry>]
Entry.search('%ruby%') #=> [<Entry>, <Entry>, <Entry>]

=======

Copyright (c) 2008 Josh Clayton, released under the MIT license