summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorBrendan Deere <brendan@stembolt.com>2016-10-05 14:30:19 -0700
committerBrendan Deere <brendan@stembolt.com>2016-10-07 10:55:10 -0700
commitac2b2ea76d4e61bc93aa17ae8813f76e7b475bc6 (patch)
treec9c14511b1ad5b7bd94f50a4cc42ebe26063527a /app/controllers
parent29f63f28609c3743371b2389e016141c574e185b (diff)
Add filters to subscriptions index page
Allow the subscriptions index to be filtered by - created date - actionable date - subscription state - processing state - user email
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/spree/admin/subscriptions_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/spree/admin/subscriptions_controller.rb b/app/controllers/spree/admin/subscriptions_controller.rb
index c63521f..622ddca 100644
--- a/app/controllers/spree/admin/subscriptions_controller.rb
+++ b/app/controllers/spree/admin/subscriptions_controller.rb
@@ -1,7 +1,13 @@
module Spree
module Admin
class SubscriptionsController < ResourceController
+ skip_before_filter :load_resource, only: :index
+
def index
+ @search = SolidusSubscriptions::Subscription.
+ accessible_by(current_ability, :index).ransack(params[:q])
+
+ @subscriptions = @search.result(distinct: true)
end
private