This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sat Mar 15 08:53:07 -0700 2008 | |
| |
MIT-LICENSE | Mon Feb 18 19:56:05 -0800 2008 | |
| |
README | Wed Jul 02 06:51:34 -0700 2008 | |
| |
Rakefile | Mon Feb 18 19:56:05 -0800 2008 | |
| |
init.rb | Mon Feb 18 19:56:05 -0800 2008 | |
| |
lib/ | Wed Mar 11 08:30:15 -0700 2009 | |
| |
tasks/ | Mon Feb 18 19:56:05 -0800 2008 | |
| |
test/ | Mon Feb 18 19:56:05 -0800 2008 |
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






