small cubbies app scope refactor

This commit is contained in:
Maxwell Salzberg 2011-10-02 10:06:27 -07:00
parent 01fd1f23c7
commit df023e4c72

View file

@ -1,12 +1,8 @@
class AppsController < ApplicationController class AppsController < ApplicationController
def show def show
@app = 'cubbies' @app = 'cubbies'
@posts = ActivityStreams::Photo
max_time = params[:max_time] ? Time.at(params[:max_time].to_i) : Time.now 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) @posts = ActivityStreams::Photo.where(:public => true).for_a_stream(max_time, 'created_at')
).where(:public => true
).order('posts.created_at DESC'
).includes(:author => :profile).limit(30)
@commenting_disabled = true @commenting_disabled = true
@people = [] @people = []
@people_count = 0 @people_count = 0