fix for widget
This commit is contained in:
parent
6da1ceb13f
commit
c98ceae1d6
|
@ -44,8 +44,10 @@ class GalleriesController < ApplicationController
|
||||||
albums.each do |album|
|
albums.each do |album|
|
||||||
total_images = total_images + album.album_images.count
|
total_images = total_images + album.album_images.count
|
||||||
end
|
end
|
||||||
counts = counts > total_images ? counts : total_images
|
counts = counts > total_images ? total_images : counts
|
||||||
while images.count < counts and images.count < AlbumImage.count
|
abc = AlbumImage.count
|
||||||
|
counts = counts > abc ? abc : counts
|
||||||
|
while images.count < counts
|
||||||
albums.each do |album|
|
albums.each do |album|
|
||||||
img = album.album_images.sample
|
img = album.album_images.sample
|
||||||
if !images.include?(img) && img != nil
|
if !images.include?(img) && img != nil
|
||||||
|
|
Loading…
Reference in New Issue