mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
9 lines
443 B
Ruby
9 lines
443 B
Ruby
module Admin
|
|
class CommentsController < Admin::BaseController
|
|
load_and_authorize_resource
|
|
|
|
def index
|
|
@comments = Comment.accessible_by(current_ability).joins('INNER JOIN events ON commentable_id = events.id').order('events.title', 'comments.created_at DESC').group_by{ |comment| comment.commentable.conference }.map {|conference, comments| [conference, comments.group_by{|comment| comment.commentable}]}.to_h
|
|
end
|
|
end
|
|
end
|