Use helper method to build batched status edits in admin/statuses/show (#27739)
				
					
				
			This commit is contained in:
		
							parent
							
								
									b05575e242
								
							
						
					
					
						commit
						13c3e59601
					
				@ -31,6 +31,11 @@ module Admin
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private
 | 
					    private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def batched_ordered_status_edits
 | 
				
			||||||
 | 
					      @status.edits.reorder(nil).includes(:account, status: [:account]).find_each(order: :asc)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    helper_method :batched_ordered_status_edits
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def admin_status_batch_action_params
 | 
					    def admin_status_batch_action_params
 | 
				
			||||||
      params.require(:admin_status_batch_action).permit(status_ids: [])
 | 
					      params.require(:admin_status_batch_action).permit(status_ids: [])
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
				
			|||||||
@ -47,7 +47,7 @@
 | 
				
			|||||||
%h3= t('admin.statuses.history')
 | 
					%h3= t('admin.statuses.history')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%ol.history
 | 
					%ol.history
 | 
				
			||||||
  - @status.edits.reorder(nil).includes(:account, status: [:account]).find_each(order: :asc).with_index do |status_edit, i|
 | 
					  - batched_ordered_status_edits.with_index do |status_edit, i|
 | 
				
			||||||
    %li
 | 
					    %li
 | 
				
			||||||
      .history__entry
 | 
					      .history__entry
 | 
				
			||||||
        %h5
 | 
					        %h5
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user