Andrew,

Unfortunately no... you'll have to do IS NOT NULL (without the interpolation). However, that is SQL-92 compatible, so most DBMS should recognize it. DataMapper allows things like :unsubscribed_at.not => nil, but unfortunately Radiant uses AR.


Sean

Andrew Neil wrote:
Sean,

Rails 2.0.x allows you to use hashes in conditions, even for nil attributes, so you could refactor that like so:

count(:conditions => {:unsubscribed_at => nil, :subscriber_list_id => subscriber_list.id })

Is there a way to say "NOT NULL"?, e.g.

:condition => ["unsubscribed_at IS NOT ? AND subscriber_list_id = ?", nil, subscriber_list.id]

I tried this:

:conditions => {:unsubscribed_at => !nil, :subscriber_list_id => subscriber_list.id }

I also tried replacing !nil with true and 0, but without success.

Thanks,
Drew
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to