# File lib/paranoia.rb, line 30 def only_deleted if paranoia_sentinel_value.nil? return with_deleted.where.not(paranoia_column => paranoia_sentinel_value) end # if paranoia_sentinel_value is not null, then it is possible that # some deleted rows will hold a null value in the paranoia column # these will not match != sentinel value because "NULL != value" is # NULL under the sql standard quoted_paranoia_column = connection.quote_column_name(paranoia_column) with_deleted.where("#{quoted_paranoia_column} IS NULL OR #{quoted_paranoia_column} != ?", paranoia_sentinel_value) end