commentaries: migrate columns to non-null.

This commit is contained in:
evazion
2017-06-13 15:23:38 -05:00
parent abb7117996
commit 1aafdc3928
3 changed files with 39 additions and 8 deletions

View File

@@ -34,15 +34,15 @@ class ArtistCommentary < ActiveRecord::Base
end
if params[:original_present] == "yes"
q = q.where("(original_title is not null and original_title != '') or (original_description is not null and original_description != '')")
q = q.where("(original_title != '') or (original_description != '')")
elsif params[:original_present] == "no"
q = q.where("(original_title is null or original_title = '') and (original_description is null or original_description = '')")
q = q.where("(original_title = '') and (original_description = '')")
end
if params[:translated_present] == "yes"
q = q.where("(translated_title is not null and translated_title != '') or (translated_description is not null and translated_description != '')")
q = q.where("(translated_title != '') or (translated_description != '')")
elsif params[:translated_present] == "no"
q = q.where("(translated_title is null or translated_title = '') and (translated_description is null or translated_description = '')")
q = q.where("(translated_title = '') and (translated_description = '')")
end
if params[:post_tags_match].present?