docbrown/app/controllers/collections_controller.rb
Anshuman Bhardwaj e2e54b35c6
Series count to only include non empty series (#16130)
Co-authored-by: Michael Kohl <me@citizen428.net>
2022-01-18 10:22:34 +07:00

12 lines
404 B
Ruby

class CollectionsController < ApplicationController
def index
@user = User.find_by!(username: params[:username])
@collections = @user.collections.non_empty.order(created_at: :desc)
end
def show
@collection = Collection.find(params[:id])
@user = @collection.user
@articles = @collection.articles.published.order(Arel.sql("COALESCE(crossposted_at, published_at) ASC"))
end
end