Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用纯activerecord(rails)执行此sql_Sql_Ruby On Rails_Activerecord - Fatal编程技术网

如何使用纯activerecord(rails)执行此sql

如何使用纯activerecord(rails)执行此sql,sql,ruby-on-rails,activerecord,Sql,Ruby On Rails,Activerecord,我不知道如何用活动记录来管理它。我知道它不处理外部连接 SQL: 型号: Person id has_many :responses Response id belongs_to :person 有什么建议吗?:没有回答可能是个更好的名字;)哇!我的生活真的丰富了,我现在对activerecord有了越来越多的信心。谢谢你!! named_scope :without_responses, :include => :responses,

我不知道如何用活动记录来管理它。我知道它不处理外部连接

SQL:

型号:

Person
id
has_many :responses

Response
id
belongs_to :person

有什么建议吗?

:没有回答可能是个更好的名字;)哇!我的生活真的丰富了,我现在对activerecord有了越来越多的信心。谢谢你!!
named_scope :without_responses, :include    => :responses, 
                                :conditions => "responses.id IS NULL"
named_scope :without_responses, :include    => :responses, 
                                :conditions => "responses.id IS NULL"