Sha256: 04dd22b2cece66798c705e128f3f1245a441c9d232df93839c9f725d50a2cb20
Contents?: true
Size: 734 Bytes
Versions: 68
Compression:
Stored size: 734 Bytes
Contents
module Pageflow module QuotaVerification extend ActiveSupport::Concern included do rescue_from Quota::ExhaustedError do |exception| respond_to do |format| format.html do redirect_back fallback_location: admin_root_path, alert: t('pageflow.quotas.exhausted') end format.json do render(:status => :forbidden, :json => { :error_message => exception.message, :quota_name => exception.quota.name }) end end end end protected def verify_quota!(name, account) Pageflow.config.quotas.get(name, account).verify_available! end end end
Version data entries
68 entries across 68 versions & 1 rubygems