Forum: Ruby on Rails left outer join change in 1.2.1?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Benjamin Ritcey (Guest)
on 2007-02-08 19:59
(Received via mailing list)
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   | removed_email_address@domain.invalid | Hu, HXXX   | HXXX Hu   |     0 | 
NULL
   |         0 |       NULL | NULL | NULL  | NULL  | NULL         | NULL
       |      NULL |
+------+-------+----------------+--------------+-------------+-------+------------+-----------+------------+------+-------+-------+--------------+-------------+-----------+
ritcey (Guest)
on 2007-02-08 20:19
(Received via mailing list)
Eh, I switched around the logic to use a right outer join, which looks
odd, but works fine.
This topic is locked and can not be replied to.