Skip to content

Commit

Permalink
Merge pull request DMPRoadmap#2866 from DMPRoadmap/bug-usage
Browse files Browse the repository at this point in the history
Fix issue with downloads on the usage dashboard
  • Loading branch information
raycarrick-ed authored Apr 13, 2021
2 parents 858961e + 29c47d4 commit 690921c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/services/org/monthly_usage_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,32 @@ def reducer_body(acc, rec, key_target)
end

def build_from_joined_user(current_user, filtered, total = {})
joined_users = Stat::StatJoinedUser.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
joined_users = StatJoinedUser.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
joined_users.reduce(total) do |acc, rec|
reducer_body(acc, rec, :new_users)
end
end

def build_from_created_plan(current_user, filtered, total = {})
created_plans = Stat::StatCreatedPlan.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
created_plans = StatCreatedPlan.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
created_plans.reduce(total) do |acc, rec|
reducer_body(acc, rec, :new_plans)
end
end

def build_from_shared_plan(current_user, filtered, total = {})
shared_plans = Stat::StatSharedPlan.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
shared_plans = StatSharedPlan.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
shared_plans.reduce(total) do |acc, rec|
reducer_body(acc, rec, :plans_shared)
end
end

def build_from_exported_plan(current_user, filtered, total = {})
exported_plans = Stat::StatExportedPlan.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
exported_plans = StatExportedPlan.monthly_range(org: current_user.org,
filtered: filtered).order(:date)
exported_plans.reduce(total) do |acc, rec|
reducer_body(acc, rec, :downloads)
end
Expand Down

0 comments on commit 690921c

Please sign in to comment.