summaryrefslogtreecommitdiff
path: root/billing/app/controllers/subscriptions_controller.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-10-08 14:33:02 -0700
committerjessib <jessib@riseup.net>2013-10-08 14:33:02 -0700
commit4e471f6b35c012d2825f6be19e24ecd5fef8d636 (patch)
tree0b420eba4e89094e0f1407aa09094d40b068fa5b /billing/app/controllers/subscriptions_controller.rb
parent8b378d916caeaf7fd4b1da2aea45eab4b0ccbb39 (diff)
Consider pending & past due subscriptions as 'active' in the sense that they should prevent one from adding a new subscription.
Diffstat (limited to 'billing/app/controllers/subscriptions_controller.rb')
-rw-r--r--billing/app/controllers/subscriptions_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/billing/app/controllers/subscriptions_controller.rb b/billing/app/controllers/subscriptions_controller.rb
index 7689f35..4758adb 100644
--- a/billing/app/controllers/subscriptions_controller.rb
+++ b/billing/app/controllers/subscriptions_controller.rb
@@ -1,7 +1,7 @@
class SubscriptionsController < BillingBaseController
before_filter :authorize
before_filter :fetch_subscription, :only => [:show, :destroy]
- before_filter :confirm_no_active_subscription, :only => [:new, :create]
+ before_filter :confirm_no_pending_active_pastdue_subscription, :only => [:new, :create]
# for now, admins cannot create or destroy subscriptions for others:
before_filter :confirm_self, :only => [:new, :create]
@@ -38,10 +38,10 @@ class SubscriptionsController < BillingBaseController
end
- def confirm_no_active_subscription
+ def confirm_no_pending_active_pastdue_subscription
@customer = Customer.find_by_user_id(@user.id)
if subscription = @customer.subscriptions # will return active subscription, if it exists
- redirect_to subscription_path(subscription.id), :notice => 'You already have an active subscription'
+ redirect_to user_subscription_path(@user, subscription.id), :notice => 'You already have a subscription'
end
end