From f08fab60b8d297c26d2461b61420755b5dc39fcf Mon Sep 17 00:00:00 2001 From: joegatt Date: Sat, 25 May 2013 17:31:29 +0200 Subject: [PATCH] Changes SQL syntax from "... NOT NULL" to "... IS NOT NULL" for PG compatibility. --- app/models/source.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/source.rb b/app/models/source.rb index a994214c..2516e5fe 100644 --- a/app/models/source.rb +++ b/app/models/source.rb @@ -11,10 +11,10 @@ class Source < ActiveRecord::Base default_scope :order => 'tag' # See http://stackoverflow.com/questions/3875564 - scope :citable, where("title NOT ? AND tag NOT ?", nil, nil) - scope :publishable, where("title NOT ? AND tag NOT ?", nil, nil) + scope :citable, where("title IS NOT ? AND tag IS NOT ?", nil, nil) + scope :publishable, where("title IS NOT ? AND tag IS NOT ?", nil, nil) .joins('left outer join notes_sources on sources.id = notes_sources.source_id') - .where('notes_sources.source_id NOT ?', nil) + .where('notes_sources.source_id IS NOT ?', nil) .uniq scope :need_syncdown, where("dirty = ? AND attempts <= ?", true, Settings.notes.attempts) scope :maxed_out, where("attempts > ?", Settings.notes.attempts).order('updated_at')