Rails — Rewrite ActiveRecord results

Get results

results = Post.all

Rewrite

results.map do |result|
  [
    id,
    name + "rewrited"
  ]
end
Advertisements