如何使用纯activerecord(rails)执行此sql
我不知道如何用活动记录来管理它。我知道它不处理外部连接 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,
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"