Eh, I switched around the logic to use a right outer join, which looks
odd, but works fine.
On Feb 8, 12:58 pm, Benjamin Ritcey
<brit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I had a left outer join that suddenly stopped working; did anything
> change in 1.2.1? dev trac appears to be down...
>
> Am I suddenly doing something dumb?
>
> In case the wrap makes this too hard to follow:http://pastie.caboo.se/38858
>
> # this should show all Users who aren''t in TempUsers>>
User.find(:all, :joins => ''as u left outer join temp_users as tu on
>
> tu.login = u.login where tu.login is null'')
>
> # there is one record, but it''s giving nulls
> => [#<User:0xb59febc8 @attributes={"dept_code"=>nil,
"manager_id"=>nil,
> "common_name"=>nil, "deleted_at"=>nil,
"admin"=>"0", "id"=>nil,
> "display_name"=>nil, "login"=>nil,
"email"=>nil}, @readonly=true>]
>
> mysql> SELECT * FROM users as u left outer join temp_users as tu on
> tu.login = u.login where tu.login is null;
>
+------+-------+----------------+--------------+-------------+-------+------------+-----------+------------+------+-------+-------+--------------+-------------+-----------+
> | id | login | email | display_name | common_name | admin |
> deleted_at | dept_code | manager_id | id | login | email |
> display_name | common_name | dept_code |
>
+------+-------+----------------+--------------+-------------+-------+------------+-----------+------------+------+-------+-------+--------------+-------------+-----------+
> | 4793 | hhu | h...-jE/qYTQ0Bw4@public.gmane.org | Hu, HXXX | HXXX Hu
| 0 | NULL
> | 0 | NULL | NULL | NULL | NULL | NULL | NULL
> | NULL |
>
+------+-------+----------------+--------------+-------------+-------+------------+-----------+------------+------+-------+-------+--------------+-------------+-----------+
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---