Skip to content

Commit 71fd0cd

Browse files
authored
Merge pull request #2524 from mikej/show-chapter-how-you-found-us-stats-follow-up
Follow up to adding of "how you found us" summary to the chapter admin page
2 parents 3e32095 + bbf09f9 commit 71fd0cd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

app/presenters/how_you_found_us_presenter.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class HowYouFoundUsPresenter
2-
32
def initialize(chapter)
43
@chapter = chapter
54
end
@@ -15,7 +14,7 @@ def by_percentage
1514
exact = (count / total_responses.to_f) * 100
1615
percentage_value = exact.floor
1716
remainder = exact - percentage_value
18-
{ how: how, percentage_value: percentage_value, remainder: remainder }
17+
{ how:, percentage_value:, remainder: }
1918
end
2019

2120
allocated_so_far = entries.sum { |entry| entry[:percentage_value] }
@@ -40,7 +39,7 @@ def data_present?
4039
private
4140

4241
def raw_stats
43-
@stats ||= @chapter.members.where.not(how_you_found_us: nil).group(:how_you_found_us).count
42+
@raw_stats ||= @chapter.members.where.not(how_you_found_us: nil).group(:how_you_found_us).count
4443
end
4544

4645
def how_values

0 commit comments

Comments
 (0)