default_scope中模型的日期条件
我想确保只有带有观看日期的电影才能按照升序返回并按该值排序。
我认为我与以下内容非常接近:
default_scope :conditions => { :watched_date => not null },
:order => 'watched_date ASC'
但我不知道如何为非空日期添加条件。
没有找到相关结果
已邀请:
1 个回复
揽芳僵迷仇
您可能希望包含表名,因为这在联接中使用,如下所示: