diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index d964ed530..74b746b04 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -1,12 +1,8 @@ class AppsController < ApplicationController def show @app = 'cubbies' - @posts = ActivityStreams::Photo max_time = params[:max_time] ? Time.at(params[:max_time].to_i) : Time.now - @posts = @posts.where(ActivityStreams::Photo.arel_table[:created_at].lt(max_time) - ).where(:public => true - ).order('posts.created_at DESC' - ).includes(:author => :profile).limit(30) + @posts = ActivityStreams::Photo.where(:public => true).for_a_stream(max_time, 'created_at') @commenting_disabled = true @people = [] @people_count = 0