Fix query to work in postgresql
This commit is contained in:
parent
c9ee626258
commit
23574c7790
2
main.rb
2
main.rb
@ -39,7 +39,7 @@ get '/' do
|
||||
SELECT
|
||||
COUNT(1) AS total,
|
||||
SUM(size) AS bytes
|
||||
FROM (select size from downloads group by video_id) as x;
|
||||
FROM (select MAX(size) AS size from downloads group by video_id) as x;
|
||||
")[0]
|
||||
|
||||
videos = ActiveRecord::Base.connection.execute("select count(1) AS total from videos;")[0]
|
||||
|
Loading…
Reference in New Issue
Block a user