   @checkUserSubscription = secure ({connection:{delegate}}, planCode, callback)->
     @fetchAllSubscriptions {
       planCode
-      userCode : "user_#{delegate._id}"
-      $or      : [
+      $or: [
         {status: 'active'}
         {status: 'canceled'}
       ]

module.exports = class JPaymentSubscription extends jraphical.Module

  {secure, dash} = require 'bongo'
  JUser    = require '../user'
  JPayment = require './index'


      JPaymentPlan.some { planCode }, {}, (err, plans)->
        return callback err  if err
        planMap = {}
        planMap[plan.planCode] = plan  for plan in plans
        sub.plan = planMap[sub.planCode]  for sub in subs

        callback null, subs
