Skip to content

Commit

Permalink
Merge pull request #6 from integrallis/fix-redirect-without-scope
Browse files Browse the repository at this point in the history
fix: issue #5 - redirect_to_sign_up fails with missing param (scope)
  • Loading branch information
bsbodden authored Nov 14, 2017
2 parents 328d916 + c78eff7 commit 130acf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/controllers/stripe_saas/subscriptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ def redirect_to_sign_up
plan = ::Plan.by_stripe_id(params[:plan]).try(:first)
end

devise_scope = (StripeSaas.devise_scope || StripeSaas.subscriptions_owned_by).to_s

if plan
unless plan.free?
session["user_return_to"] = new_subscription_path(plan: plan)
end

devise_scope = (StripeSaas.devise_scope || StripeSaas.subscriptions_owned_by).to_s
redirect_to new_registration_path(devise_scope, plan: plan)
else
redirect_to new_registration_path
redirect_to new_registration_path(devise_scope)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/stripe_saas/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module StripeSaas
VERSION = "0.0.8"
VERSION = "0.0.9"
end

0 comments on commit 130acf9

Please sign in to comment.