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 (
union /
| name | age | message | |
|---|---|---|---|
| |
README | Fri Jun 26 09:21:57 -0700 2009 | |
| |
init.rb | Fri Feb 27 19:47:54 -0800 2009 | |
| |
lib/ | Fri Feb 27 20:05:14 -0800 2009 |
README
Plugin Details
--------------
This is an extremely naive 'railsification' of a SQL union.
The first parameter, parts, is an array of hashes. Each hash is what you would normally send into a single find and
represents each SELECT that will eventually be unioned together.
The second paramter, options, is a hash of remaining options to be applied to the UNION of the parts (ie: order, limit,
offset).
A simple (and useless) example would be:
User.union([{:conditions => ['name = ?', 'tom']}, {:conditions => ['name = ?', 'gary']}], {:order => 'created_at'})
This example produces the following SQL:
(SELECT * FROM `users` WHERE (name = 'tom')) UNION (SELECT * FROM `users` WHERE (namae = 'gary')) ORDER BY created_at;
Essentially you can do any union, but it's up to you to make sure you don't pass the wrong stuff in because it's a
pretty dumb implementation.
License
-------
This plugin is available under the MIT license.
Author
------
Thomas Mango
http://slicedsoftware.com






