default_scope中模型的日期条件

我想确保只有带有观看日期的电影才能按照升序返回并按该值排序。 我认为我与以下内容非常接近:
default_scope :conditions => { :watched_date => not null },
              :order => 'watched_date ASC'
但我不知道如何为非空日期添加条件。     
已邀请:
如果你改变条件,它是否有用?:
:conditions => 'watched_date IS NOT NULL'
您可能希望包含表名,因为这在联接中使用,如下所示:
:conditions => 'movies.watched_date IS NOT NULL'
    

要回复问题请先登录注册