Sha256: 429b591e3830cdd492f3f750bdc29fec56dc233f438d99f528bbfadd1509e33a
Contents?: true
Size: 1.26 KB
Versions: 68
Compression:
Stored size: 1.26 KB
Contents
module Pageflow module Editor class EncodingConfirmationsController < Pageflow::ApplicationController respond_to :json before_action :authenticate_user! def create entry = DraftEntry.find(params[:entry_id]) authorize!(:confirm_encoding, entry.to_model) @encoding_confirmation = build_encoding_confirmation(entry) @encoding_confirmation.save! render(json: {}) rescue EncodingConfirmation::QuotaExceededError render(action: :check, status: :forbidden) end def check entry = DraftEntry.find(params[:entry_id]) authorize!(:confirm_encoding, entry.to_model) @encoding_confirmation = build_encoding_confirmation(entry) end private def build_encoding_confirmation(entry) EncodingConfirmation.new(entry, encoding_confirmation_params, encoding_quota(entry), current_user) end def encoding_confirmation_params params.require(:encoding_confirmation).permit(video_file_ids: [], audio_file_ids: []) end def encoding_quota(entry) Pageflow.config.quotas.get(:encoding, entry.account) end end end end
Version data entries
68 entries across 68 versions & 1 rubygems