🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.ruby
Article #883

Re: ORM i subquering

#883
From: Jaroslaw Zabiello
Date: Sun, 06 Jan 2008 15:16
15 lines
1280 bytes
On Sun, 06 Jan 2008 09:46:43 -0000, Maciej Piechotka  
<uzytkownik2@gmail.com> wrote:

> Jesteś pewien? Mi działa bez:
>
> irb> User.filter(:id => Post.filter{:priority >= 4}.select(:user_id)).sql
> => "SELECT * FROM users WHERE (id IN (SELECT user_id FROM posts WHERE
> (priority >= 4)))"

Hmm, faktycznie. Coś musiałem zamieszać, że mi wyskoczyło bez.

-- 
Jarosław Zabiełło
http://blog.zabiello.com
irc://irc.eu.freenode.net/rubyonrails.pl
Technical Details
Message-ID: <op.t4iko8acr2rg33@jzmbp.local>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <vtt455-f5d.ln1@router.piechotka.com.pl> <op.t4hlryz2r2rg33@jzmbp.local> <3lk655-5ku.ln1@router.piechotka.com.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "Jaroslaw Zabiello" <abuse@tpnet.pl>
Newsgroups: pl.comp.lang.ruby
Subject: Re: ORM i subquering
Date: Sun, 06 Jan 2008 15:16:10 -0000
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 15
Message-ID: <op.t4iko8acr2rg33@jzmbp.local>
References: <vtt455-f5d.ln1@router.piechotka.com.pl> <op.t4hlryz2r2rg33@jzmbp.local> <3lk655-5ku.ln1@router.piechotka.com.pl>
NNTP-Posting-Host: 89.127.178.166
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1199632571 28826 89.127.178.166 (6 Jan 2008 15:16:11 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Sun, 6 Jan 2008 15:16:11 +0000 (UTC)
X-User: hipertracker
User-Agent: Opera Mail/9.25 (MacIntel)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit