Skip to content

Commit

Permalink
speed up comment loading
Browse files Browse the repository at this point in the history
  • Loading branch information
SepsiLaszlo committed Jan 12, 2025
1 parent 2ce3f0b commit 9d8c8fb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/controllers/point_detail_comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def update_params
def comments_by_principle_user_id(principle_id, user_id)
PointDetailComment.includes([{ point_detail: [:point_request] }])
.order(:created_at)
.select do |comment|
comment.point_detail.principle_id == principle_id &&
comment.point_detail.point_request.user_id == user_id
end
.where('point_details.principle_id': principle_id, 'point_requests.user_id': user_id)
end

def authorize_comment
Expand Down

0 comments on commit 9d8c8fb

Please sign in to comment.