lib/freemium/manual_billing.rb
# a subscription is due on the last day it's paid through. so this finds all
# subscriptions that expire the day *after* the given date. note that this
# also finds past-due subscriptions, as long as they haven't been set to
# expire.
a subscription is due on the last day it's paid through. so this finds all
subscriptions that expire the day *after* the given date. note that this
also finds past-due subscriptions, as long as they haven't been set to
expire.
a subscription is due on the last day it ' s paid through . so this finds all subscriptions that expire the day * after * the given date . note that this also finds past - due subscriptions as long as they haven ' t been set to expire .
def find_billable(date = Date.today)
        find(
          :all,
          :include => :subscription_plan,
          :conditions => ['subscription_plans.rate_cents > 0 AND paid_through <= ? AND (expire_on IS NULL or expire_on < paid_through)', date.to_date]
        )
      end
def find_billable ( date = Date . today ) find ( :all , :include => :subscription_plan , :conditions => [ 'subscription_plans.rate_cents > 0 AND paid_through <= ? AND (expire_on IS NULL or expire_on < paid_through)' , date . to_date ] ) end
a subscription is due on the last day it's paid through.
a subscription is due on the last day it ' s paid through .
date
<not_specific>
today
<not_specific>