<% scope = Message.scoped({}) scope = scope.where("#{Message.table_name}.parent_id IS NULL") scope = scope.where(["#{Board.table_name}.project_id = ?", @project.id]) if @project @latest_topics = scope.visible.includes(:board).order("#{Message.table_name}.created_on DESC").limit(5) %>

<%= l(:label_questions_latest_messages) %>