You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: post_statuses_controller.rb
    path of file: ./repos/astuto/app/controllers
    
    the code of the file until where you have to start completion: class PostStatusesController < ApplicationController
  include ApplicationHelper
  
  before_action :authenticate_user!, only: [:create, :update, :update_order, :destroy]

  def index
    post_statuses = PostStatus.order(order: :asc)

    render json: post_statuses
  end

  def create
    post_status = PostStatus.new(post_status_params)
    authorize post_status

    if post_s
    
  def update_order
    authorize PostStatus
    
    workflow_output = ReorderWorkflow.new(
      entity_classname: PostStatus,
      column_name: 'order',
      entity_id: params[:post_status][:id],
      src_index: params[:post_status][:src_index],
      dst_index: params[:post_status][:dst_index]
    ).run

    if workflow_output
      render json: workflow_output
    else
      render json: {
        error: t("errors.post_status.update_order")
      }, status: :unprocessable_entity
    end