Skip to content

Instantly share code, notes, and snippets.

@braidn
Created September 9, 2013 17:01
Show Gist options
  • Save braidn/6498495 to your computer and use it in GitHub Desktop.
Save braidn/6498495 to your computer and use it in GitHub Desktop.
module Quarterly
class ContributorsReport
class SubscriptionPlanPresenter < SimpleDelegator
def next_issue_number
product.available_on? ? super : "N/A"
end
def next_issue_ships_on
product.available_on? ? super : "N/A"
end
def next_issue_subscriber_count
return 0 unless product.available_on?
subscriptions.active(__getobj__.next_issue_ships_on).count
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment