我正在尝试像这样从activerecord组请求中获取二维哈希。
MachineFailure.group("machine.key", "failure.name").sum("timestampdiff(hour, machine_failures.created_at, closed_at)")
这会给我返回一个哈希,例如:
{[“ R01”,“纠正性维护”] => 3,[“ R01”,“自动重启”] => 8}
当我实际上需要这样的东西时:
{“ R01” => {“纠正性维护” => 3,“自动重启” => 8}}
thx