i have a scenario where i am sending notification mail to all users.hence i need to get all info such as useremail,videocount,imagecount,videoids,imageids etc and send to usermailer to send mail.i want to simplify this process by sending all required parameters to the method and again looping through each array of arrays.
for example:-
###########the below code is in a loop of users################
User.signed_in_users.find_in_batches(:batch_size => 100 ) { |users| users.each { |user|
vcount=Video.where(:users_notified=>f).count
icount=Image.where(:users_notified=>f).count
acount=Audio.where(:users_notified=>f).count
@count << vcount + icount + acount
vcat=###ALL VIDEO CATEGORIES
icat=###ALL IMAGE CATEGORIES
acat=###ALL AUDIO CATEGORIES
@cats << vcat + icat + acat...and many more
###########now sending all these parameter to mailer(array of arrays)
####how i can simplify this call
UserMailer.notify_user(user.email,@video_cat,@video_count,@image_cat,@image_count,@audio_cat,@audio_count,@place_cat,@place_count,@Lpage_count,@Dpage_count).deliver
} } ###loop ends