用 active_model_serializers 做序列化
render json: { status: $conf[:ok], result: UserSerializer.new(user) }
虽然正常返回,但是日志输出:
[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (3.57ms)
Completed 200 OK in 101ms (Views: 7.9ms | ActiveRecord: 5.8ms)
这句话虽然不影响结果,但是看着很不爽,关了好几次都没关掉。搜索一圈也没有好的答案。有遇到过的朋友吗?
[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (3.57ms)