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 4a0def03cc6b4f00a09a65bc2b51b7353632db11
tree aca2427b6b91b7b932e07c4356ef906038be263e
parent 46d07af3c32cf1aa85f23c6658c6399ea65b8e66
tree aca2427b6b91b7b932e07c4356ef906038be263e
parent 46d07af3c32cf1aa85f23c6658c6399ea65b8e66
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Wed Apr 22 07:07:31 -0700 2009 | |
| |
README.rdoc | Wed Apr 22 07:26:59 -0700 2009 | |
| |
Rakefile | Wed Apr 22 07:07:31 -0700 2009 | |
| |
init.rb | Wed Apr 22 07:13:55 -0700 2009 | |
| |
install.rb | Wed Apr 22 07:07:31 -0700 2009 | |
| |
lib/ | Thu Sep 03 03:50:51 -0700 2009 | |
| |
tasks/ | Wed Apr 22 07:07:31 -0700 2009 | |
| |
test/ | Wed Apr 22 07:07:31 -0700 2009 | |
| |
uninstall.rb | Wed Apr 22 07:07:31 -0700 2009 |
README.rdoc
ScopeGroup
ScopeGroup is a Ruby On Rails plugin providing dynamic named_scope grouping.
You can aggregate a group of named scope together during runtime and run them together only when methods like ‘find’, ‘count’, ‘average’, etc are called.
Install
script/plugin install git://github.com/robin/scopegroup.git
Example
Suppose Post is an activerecord model:
scope_group = ScopeGroup.new Post scope_group.named_scope1 scope_group.named_scope2(1) scope_group.find(:all)
is equivalent to:
Post.named_scope1.named_scope2(1)
You can also use append_scope as:
scope_group = ScopeGroup.new Post scope_group.append_scope :named_scope1 scope_group.append_scope :named_scope2, 1 scope_group.count
, which is equivalent to:
Post.named_scope1.named_scope2(1).count
Author
| Author: | Robin Lu @ IN-SRC Studio |
| Company Web Site: | www.in-src.com |
Copyright © 2009 Robin Lu @ IN-SRC Studio , released under the MIT license







