fixed infinite loop problem and also changed some engine settings
This commit is contained in:
1 parent
91ef557cf2
commit
6ec8f6a5c0
2 files changed
+9
-6
No files matched your search
@@ -34,11 +34,14 @@ class GalleriesController < ApplicationController
|
||||
params = OrbitHelper.params
|
||||
|
||||
images = []
|
||||
while images.count < 9 and images.count < AlbumImage.count
|
||||
albums.each do |album|
|
||||
img = album.album_images.sample
|
||||
if !images.include?(img) && img != nil
|
||||
images << img
|
||||
|
||||
if !albums.blank?
|
||||
while images.count < 9 and images.count < AlbumImage.count
|
||||
albums.each do |album|
|
||||
img = album.album_images.sample
|
||||
if !images.include?(img) && img != nil
|
||||
images << img
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user