Commit af5afe04

mo khan <mo@mokhan.ca>
2013-07-15 01:02:58
filter out creations without photos from the api
1 parent 79ed2e2
Changed files (1)
app
controllers
app/controllers/api/v1/creations_controller.rb
@@ -5,7 +5,7 @@ module Api
       respond_to :json
 
       def index
-        @creations = Creation.all.take(50)
+        @creations = Creation.includes(:user, :photos).where(:is_restricted => false).where('photos_count > 0').uniq
       end
 
       private