Sha256: 69d4529c6d97977a3738997fc0d4cbcc56ce5c69ecbfb074c0775df981c6ad8e
Contents?: true
Size: 1.26 KB
Versions: 19
Compression:
Stored size: 1.26 KB
Contents
module Pageflow module Editor class EncodingConfirmationsController < Pageflow::ApplicationController respond_to :json before_filter :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
19 entries across 19 versions & 1 rubygems