Commit c22a1feb

mo khan <mo@mokhan.ca>
2014-06-02 03:00:51
display a random photo from the album as the primary image.
1 parent 4ef4564
Changed files (1)
app
app/models/creation.rb
@@ -15,7 +15,7 @@ class Creation < ActiveRecord::Base
   end
 
   def primary_image
-    photos.any? ? photos.first : Photo.new
+    photos.any? ? photos.sample : Photo.new
   end
 
   def published?