Skip to content
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

group_by_day returns nil when dates.keys.first is not a String #180

Open
VitaliyAdamkov opened this issue Jan 10, 2018 · 0 comments
Open

Comments

@VitaliyAdamkov
Copy link

VitaliyAdamkov commented Jan 10, 2018

ruby 2.3.1
rails 4.2
upmin 0.1.3

Started GET "/admin" for 127.0.0.1 at 2018-01-10 12:22:16 +0200
Processing by Upmin::DashboardController#index as HTML
User Load (2.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
Pair Load (1.1ms) SELECT "pairs".* FROM "pairs" ORDER BY date(created_at) DESC LIMIT 1
Pair Load (0.9ms) SELECT "pairs".* FROM "pairs" ORDER BY date(created_at) ASC LIMIT 1
CACHE (0.0ms) SELECT "pairs".* FROM "pairs" ORDER BY date(created_at) DESC LIMIT 1
CACHE (0.0ms) SELECT "pairs".* FROM "pairs" ORDER BY date(created_at) ASC LIMIT 1
(0.7ms) SELECT COUNT(*) AS count_all, date(created_at) AS date_created_at FROM "pairs" WHERE ("pairs"."created_at" IS NOT NULL) GROUP BY date(created_at) ORDER BY date(created_at) ASC
Rendered /home/adamkov/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/upmin-admin-0.1.3/app/views/upmin/dashboard/_chart.html.haml (14.8ms)
Rendered /home/adamkov/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/upmin-admin-0.1.3/app/views/upmin/dashboard/index.html.haml within layouts/upmin/application (15.8ms)
Completed 401 Unauthorized in 33ms (ActiveRecord: 5.5ms)
NoMethodError - undefined method `each_with_object' for nil:NilClass

it works like a charm when it will return [] in that case

##181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant