Created
September 10, 2013 14:56
-
-
Save braidn/6510643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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