diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 829052d0b..8a4c06ece 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -626,20 +626,14 @@ class TicketsController < ApplicationController assets = attributes_to_change[:assets] assets = ticket.assets(assets) - # get related articles - articles = Ticket::Article.where(ticket_id: ticket.id).order('created_at ASC, id ASC') - # get related users article_ids = [] - articles.each { |article| + ticket.articles.order('created_at ASC, id ASC').each { |article| # ignore internal article if customer is requesting next if article.internal == true && current_user.permissions?('ticket.customer') - # load article ids article_ids.push article.id - - # load assets assets = article.assets(assets) }