app/controllers/iugu/plan_controller.rb in iugusdk-1.0.0.alpha.21 vs app/controllers/iugu/plan_controller.rb in iugusdk-1.0.0.alpha.22
- old
+ new
@@ -7,20 +7,21 @@
def change
return unless params[:plan]
params[:id] ? @account = current_user.accounts.find(params[:id]) : @account = current_user_account.account
- subscription = Iugu::Api::Subscription.find @account.subscription_id
- subscription.change_plan params[:plan]
+ subscription = Iugu::Api::Subscription.find @account.subscription_id.to_uuid.to_s
+ @account.clear_cached_subscription_features if subscription.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
+
+ @subscription = Iugu::Api::Subscription.find @account.subscription_id.to_uuid.to_s
end
end