hide expired and job-specific auth tokens from workbench list
authorTom Clegg <tom@clinicalfuture.com>
Wed, 10 Jul 2013 09:01:51 +0000 (05:01 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Wed, 10 Jul 2013 09:01:51 +0000 (05:01 -0400)
apps/workbench/app/controllers/api_client_authorizations_controller.rb

index 8eed5526093563e94c546dc6c991aff0aa0665fa..1c55b116efad1b48c41b70d9cfbe70b221efeffb 100644 (file)
@@ -1,2 +1,8 @@
 class ApiClientAuthorizationsController < ApplicationController
+  def index
+    @objects = model_class.all.to_ary.reject do |x|
+      x.api_client_id == 0 or (x.expires_at and x.expires_at < Time.now) rescue false
+    end
+    super
+  end
 end