orbit-basic/app/helpers/admin/ad_banner_helper.rb

16 lines
381 B
Ruby

module Admin::AdBannerHelper
def preview_block_ad_images_helper(ad_banner)
printable_ad_images = []
ad_banner.ad_images.each do |ad_image|
if ad_image.display?
ad_image.weight.times do
printable_ad_images << ad_image
end
end
end
printable_ad_images.shuffle!
end
end