Re: has_many

Sam Mayes
2005-09-05T03:26:29Z

Thanks justin,

Have the book forgot to search more in the api.

sam

On 9/4/05, Andrew Stone
<stonelists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
> Sam,
>
> I''m still learning rails, but I think this may help...
>
> to get the first price:
>
> Prices.find(:first, :conditions => ["system_id =
?",@systems[counter].id])
>
> to get the first three
>
> Prices.find(:first, :conditions => ["system_id =
?",@systems[counter].id],
> :limit => 3)
>
> Of course, this depends on your model/class name and table structure...
>
> --
> Andrew Stone
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>