In SQL it should look like this:
SELECT * FROM `categories_description_old` WHERE ((`categories_description` = '') OR (`categories_name` = '') OR (`categories_heading_title` = ''))
My (ugly) solution:
conditions = [:categories_name, :categories_heading_title, :categories_description]
b = table_categories_description_old.filter(conditions.pop => "")
conditions.each do |m|
b = b.or(m => "")
end
Is there a better solution to chain the or conditions?
filter(false)
instead, otherwise conditions are not checked – Spill