[Rails] UNCLE!!!

Duane Johnson duane.johnson at gmail.com
Tue Feb 1 00:57:06 GMT 2005


Are you looking for http://api.rubyonrails.com?

Here's what they have to say about find_all there:

find_all(conditions = nil, orderings = nil, limit = nil, joins = nil)

Returns an array of all the objects that could be instantiated from
the associated table in the database. The conditions can be used to
narrow the selection of objects (WHERE-part), such as by "color =
'red'", and arrangement of the selection can be done through orderings
(ORDER BY-part), such as by "last_name, first_name DESC". A maximum of
returned objects and their offset can be specified in limit
(LIMIT…OFFSET-part). Examples:

  Project.find_all "category = 'accounts'", "last_accessed DESC", 15
  Project.find_all ["category = ?", category_name], "created ASC", ["?
OFFSET ?", 15, 20]



On Mon, 31 Jan 2005 18:47:59 -0600, James G. Stallings II
<twitch at mw.merseine.nu> wrote:
> Ok, I ALMOST made it through adding comments to my blog without asking
> for help.
> 
> I think I need some clause for find_all that allows me to say something
> like find_all(post_id), where post id is the value of the post_id field
> in the post row associated with the comments I'm attempting to retrieve
> and process.
> 
> I have it all working, if a little roughly, except that my retrieval
> loop retrieves all comments.
> 
> Can someone point to the place things like find_all are documented? I
> hate to keep running to the list with trivialities I'm capable
> referencing for myself :)
> 
> Thanks!
> Twitch
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


More information about the Rails mailing list