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 (
commit 7508227c39d67c1d5a2fa4db29064e16e3aa624a
tree d49b621e6d8065e0026375d9b0c8f5d425a73301
parent a399d13f94ca99b0653eda5d55c0aa14cd867f33
tree d49b621e6d8065e0026375d9b0c8f5d425a73301
parent a399d13f94ca99b0653eda5d55c0aa14cd867f33
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sat Mar 15 08:53:07 -0700 2008 | [joshuaclayton] |
| |
MIT-LICENSE | Mon Feb 18 19:56:05 -0800 2008 | [jclayton] |
| |
README | Wed Jul 02 06:48:11 -0700 2008 | [joshuaclayton] |
| |
Rakefile | Mon Feb 18 19:56:05 -0800 2008 | [jclayton] |
| |
init.rb | Mon Feb 18 19:56:05 -0800 2008 | [jclayton] |
| |
lib/ | Wed Jul 02 06:48:11 -0700 2008 | [joshuaclayton] |
| |
tasks/ | Mon Feb 18 19:56:05 -0800 2008 | [jclayton] |
| |
test/ | Mon Feb 18 19:56:05 -0800 2008 | [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




