Skip to content

Instantly share code, notes, and snippets.

@braidn
Created September 10, 2013 14:56
Show Gist options
  • Save braidn/6510643 to your computer and use it in GitHub Desktop.
Save braidn/6510643 to your computer and use it in GitHub Desktop.
module Quarterly
class ContributorsPerformanceReport
def initialize(context, search_params)
@context = context
@search_params = search_params
end
def render
@context.render(
'quarterly/reports/contributors_performance_report', locals: {
subscription_plans: presented_subscription_plans,
search: ransack_plans(@search_params),
presenter: ContributorsPerformancePresenter
})
end
private
def presented_subscription_plans
ContributorsPerformanceCollectionPresenter.new(ransack_plans(@search_params))
end
def ransack_plans(search_params)
SubscriptionPlan.includes(:product, :contributor).ransack(search_params)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment