skip-loading-changesets.patch

Go MAEDA, 2022-07-29 03:19

Download (1.23 KB)

View differences:

app/controllers/issues_controller.rb
94 94

  
95 95
  def show
96 96
    @journals = @issue.visible_journals_with_index
97
    @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists?
97
    @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists? unless api_request?
98 98
    @relations =
99 99
      @issue.relations.
100 100
        select do |r|
......
119 119
      end
120 120
      format.api do
121 121
        @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
122
        @changesets = @issue.changesets.visible.preload(:repository, :user).to_a
123
        @changesets.reverse! if User.current.wants_comments_in_reverse_order?
122
        if include_in_api_response?('changesets')
123
          @changesets = @issue.changesets.visible.preload(:repository, :user).to_a
124
          @changesets.reverse! if User.current.wants_comments_in_reverse_order?
125
        end
124 126
      end
125 127
      format.atom do
126 128
        render :template => 'journals/index', :layout => false,