Skip to content

Instantly share code, notes, and snippets.

@mipearson
Forked from bsodmike/helper.rb
Created November 23, 2011 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mipearson/1cb87f7eadbae14a829c to your computer and use it in GitHub Desktop.
Save mipearson/1cb87f7eadbae14a829c to your computer and use it in GitHub Desktop.
module Admin::VideosHelper
def any_are_blank? r, check
(check.find { |j| r.send(j).blank? }) != nil
end
def any_not_exist? r, check
(check.find { |j| !r.send(j).exists? }) != nil
end
end
# r.en_title.blank? || r.ar_title.blank? || r.fr_title.blank? || !r.cover_en.exists? || !r.cover_ar.exists? || !r.cover_fr.exists? || !r.insert_en.exists? || !r.insert_ar.exists? || !r.insert_fr.exists?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment