named_scope :incomplete?, lambda { |user_id, todo_id|
{ :select => 1, :conditions =>
[ "#{user_id} not in (select user_todos.user_id from user_todos) and
#{todo_id} not in (select user_todos.todo_id from user_todos)" ]
}
}
我得到一个零结果。我希望它回归真实。我该做什么!?如何在named_scope中返回布尔结果?
另外,有没有更好的方式来写这个?
请问格式化代码?只需点击按钮编辑您的问题,突出显示代码,然后点击“101/010”。 – 2010-01-15 04:42:57