app/policies/pirep_policy.rb
# rubocop:disable Metrics/MethodLength
# TODO Rubcop doesn't like this (rightfully so). There are lot of parameters
#      we need to submit on PIREP forms depending on the user. Clean ths up.
#
disable Metrics/MethodLength
TODO Rubcop doesn't like this (rightfully so). There are lot of parameters
we need to submit on PIREP forms depending on the user. Clean ths up.
disable Metrics / MethodLength TODO Rubcop doesn ' t like this ( rightfully so ) . There are lot of parameters we need to submit on PIREP forms depending on the user . Clean ths up .
def permitted_attributes
    if @user.can?(Pirep, :update)
      [
        :date, :airline_id, :flight, :leg, :orig_icao, :dest_icao,
        :route, :equipment_id, :simulator_id, :duration, :network_id,
        :status_id, :draft, comments_attributes: %i[_destroy id body]
      ]
    else
      [
        :date, :airline_id, :flight, :leg, :orig_icao, :dest_icao,
        :route, :equipment_id, :simulator_id, :duration, :network_id, :draft,
        comments_attributes: %i[id body]
      ]
    end
  end
def permitted_attributes if @user . can? ( Pirep , :update ) [ :date , :airline_id , :flight , :leg , :orig_icao , :dest_icao , :route , :equipment_id , :simulator_id , :duration , :network_id , :status_id , :draft , comments_attributes : %i[ _destroy id body ] ] else [ :date , :airline_id , :flight , :leg , :orig_icao , :dest_icao , :route , :equipment_id , :simulator_id , :duration , :network_id , :draft , comments_attributes : %i[ id body ] ] end end
rubocop:disable Metrics/MethodLength
TODO Rubcop doesn't like this (rightfully so).
rubocop : disable Metrics / MethodLength TODO Rubcop doesn ' t like this ( rightfully so ) .