是否有类似的内容:
Model.pluck(:id, :created_at_before_type_cast) # this does not work :)
因为当我这样做时:
Model.pluck(:id, :created_at)
我明白了:
[1, 22 Feb 2018 13:15:33 CET +01:00]
...
但是我需要这样的东西:
[1, 2018-02-22 12:15:33.426734]
...
答案 0 :(得分:2)
Model.pluck(:id, 'models.created_at AS created_at_before_type_cast')
似乎有效