Sha256: b25155eb2b1b6df966dfa03f717feeeef3587332dad5540fed357c3a6925e3e6

Contents?: true

Size: 797 Bytes

Versions: 13

Compression:

Stored size: 797 Bytes

Contents

class Iugu::PlanController < Iugu::AccountSettingsController
  before_filter(:only => [:index, :change]) { |c| c.must_be :owner, :id }

  def index
    params[:id] ? @account = current_user.accounts.find(params[:id]) : @account = current_user_account.account
    get_index_data
    render 'iugu/plan/index'
  end

  def change
    return unless params[:plan]
    params[:id] ? @account = current_user.accounts.find(params[:id]) : @account = current_user_account.account

    @account.change_plan(params[:plan])

    get_index_data
    render 'iugu/plan/index'
  end

  private

  def get_index_data
    @currency = locale_to_currency I18n.locale
    @plans = Iugu::Api::Plan.with_currency @currency

    @subscription = Iugu::Api::Subscription.find @account.subscription_id.to_uuid.to_s
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
iugusdk-1.0.11 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.10 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.9 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.8 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.7 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.6 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.5 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.4 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.3 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.2 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.1 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.0.alpha.32 app/controllers/iugu/plan_controller.rb
iugusdk-1.0.0.alpha.31 app/controllers/iugu/plan_controller.rb