-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add admin budget stats #3499
Add admin budget stats #3499
Conversation
|
||
ballot_1 = create(:budget_ballot, budget: @budget, user: user_1) | ||
ballot_2 = create(:budget_ballot, budget: @budget, user: user_2) | ||
ballot_3 = create(:budget_ballot, budget: @budget, user: user_3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - ballot_3. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
|
||
all_city_investment = create(:budget_investment, heading: all_city) | ||
carabanchel_investment = create(:budget_investment, heading: carabanchel) | ||
carabanchel_investment = create(:budget_investment, heading: carabanchel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - carabanchel_investment. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
barajas = create(:budget_heading, group: group_districts) | ||
|
||
all_city_investment = create(:budget_investment, heading: all_city) | ||
carabanchel_investment = create(:budget_investment, heading: carabanchel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - carabanchel_investment. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
carabanchel = create(:budget_heading, group: group_districts) | ||
barajas = create(:budget_heading, group: group_districts) | ||
|
||
all_city_investment = create(:budget_investment, heading: all_city) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - all_city_investment. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
scenario "Number of users that have supported an investment project" do | ||
user1 = create(:user, :level_two) | ||
user2 = create(:user, :level_two) | ||
user3 = create(:user, :level_two) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - user3. Did you mean user1? (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
|
||
@vote_count_by_heading = @budget.lines.group(:heading_id).count.collect {|k,v| [Budget::Heading.find(k).name, v]}.sort | ||
|
||
@user_count_by_district = User.where.not(balloted_heading_id: nil).group(:balloted_heading_id).count.collect {|k,v| [Budget::Heading.find(k).name, v]}.sort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [159/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
|
||
@vote_count = @budget.lines.count | ||
|
||
@vote_count_by_heading = @budget.lines.group(:heading_id).count.collect {|k,v| [Budget::Heading.find(k).name, v]}.sort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [122/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
@@ -29,6 +27,9 @@ def show | |||
ds.add "Budget Investments", Budget::Investment.group_by_day(:created_at).count | |||
end | |||
|
|||
if params[:user_supported_budgets].present? | |||
ds.add "User supported budgets", Vote.where(votable_type: "Budget::Investment").group_by_day(:updated_at).count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [117/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
ds.add event.titleize, Ahoy::Event.where(name: event).group_by_day(:time).count | ||
end | ||
if params[:event].present? | ||
ds.add params[:event].titleize, Ahoy::Event.where(name: params[:event]).group_by_day(:time).count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
9256fc0
to
ff5c33e
Compare
ff5c33e
to
1d25543
Compare
1d25543
to
d5c7858
Compare
References
Objectives