Sha256: e5e033394368e9552bd761da2dcf625d33fa35ce81bc88594eafb271423c6cc5

Contents?: true

Size: 586 Bytes

Versions: 12

Compression:

Stored size: 586 Bytes

Contents

module PaidUp
  class PaidUpController < ApplicationController
    helper :all

    before_action :set_locale
    before_filter :warn_if_delinquent

  private
    def set_locale
      I18n.locale = params[:locale] || I18n.default_locale
    end

    def warn_if_delinquent
      if user_signed_in? && params[:controller] != 'paid_up/subscriptions'
        if current_user.plan.nil? || current_user.stripe_data.delinquent
          flash[:error] = :account_is_delinquent.l + :to_disable_this_message_subscribe.l(subscribe_link: paid_up.plans_path)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
paid_up-0.9.13 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.12 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.11 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.10 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.9 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.8 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.7 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.6 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.5 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.4 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.3 app/controllers/paid_up/paid_up_controller.rb
paid_up-0.9.2 app/controllers/paid_up/paid_up_controller.rb