Use exec_query
for custom SQL execution
Also align how we use query Postgres from controllers. The change is mainly due to regular (but not reproducible) issues with the `intervalstyle` defaulting to `postgres` (instead of `iso8601`) and thereby causing issues. We're just experimenting to see whether this change resolves the issue.
This commit is contained in:
@ -69,7 +69,7 @@ class ExternalUsersController < ApplicationController
|
||||
|
||||
statistics = {}
|
||||
|
||||
ApplicationRecord.connection.execute(working_time_query(tag&.id)).each do |tuple|
|
||||
ApplicationRecord.connection.exec_query(working_time_query(tag&.id)).each do |tuple|
|
||||
tuple = tuple.merge('working_time' => format_time_difference(tuple['working_time']))
|
||||
statistics[tuple['exercise_id'].to_i] = tuple
|
||||
end
|
||||
|
Reference in New Issue
Block a user