-
-
Save bsodmike/f347dabb4d37f365328b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Admin::VideosHelper | |
def check_attributes(r, blank_check, exists_check) | |
trigger = false | |
blank_check.each do |i| | |
trigger = true if r.send(i.to_sym).blank? | |
end | |
exists_check.each do |j| | |
trigger = true if !r.send(j.to_sym).exists? | |
end | |
trigger | |
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
Consider incorporating
or define an instance method to call
#title(:en)