diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb index cae6bc06..579d4556 100644 --- a/app/controllers/subscriptions_controller.rb +++ b/app/controllers/subscriptions_controller.rb @@ -34,10 +34,12 @@ class SubscriptionsController < ApplicationController def prepay @invoices = current_user.paypal_invoices - .where.not(status: 'CREATED') + .where(status: 'COMPLETED') .includes(:page_unlock_promo_code) .order('id desc') - + .sort_by { |invoice| invoice.page_unlock_promo_code.uses_remaining } + .reverse + promo_code_ids = @invoices.map(&:page_unlock_promo_code_id).flatten @promo_codes = PageUnlockPromoCode.where(id: promo_code_ids) end diff --git a/app/views/main/dashboard.html.erb b/app/views/main/dashboard.html.erb index 62673b93..c28e9d99 100644 --- a/app/views/main/dashboard.html.erb +++ b/app/views/main/dashboard.html.erb @@ -11,6 +11,18 @@ <% end %> + <% unless current_user.notice_dismissals.where(notice_id: 4).any? %> +
- These codes let you prepay for however many months of Premium you'd like, and can be activated afterwards - whenever you'd like. Each code can be used only once, but can be used by anyone you share the code with — + These codes let you prepay for however many months of Premium you'd like, and can be manually activated at any time. + Each code can be used only once, but can be used by anyone you share the code with — so they make great gifts, too!