- MODEL -
class Document < ActiveRecord::Base
has_one :user,
:class_name => "User",
:foreign_key => "fkey",
:conditions => "user = ''NAME''"
end
- GENERATED SQL (per the .log) -
SELECT FIRST 1 * FROM table_name WHERE (table_name.fkey IS NULL AND
(user_id = ''NAME''))
What I can''t figure out is what the "IS NULL" is doing inside
the SQL.
Any ideas?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---