0
字段太多我有一個查詢,我只希望輸出三個變量在查詢輸出
Relationship.select('follower_id as source, followed_id as target, value').map(&:attributes)
但是我得到的結果包括id變量如下,我不想。我如何擺脫它?
{"source"=>1, "target"=>3, "value"=>1, "id"=>nil},
{"source"=>1, "target"=>4, "value"=>1, "id"=>nil},
{"source"=>1, "target"=>5, "value"=>1, "id"=>nil},
{"source"=>2, "target"=>3, "value"=>1, "id"=>nil}