I would like to get nice printing by hirb
in rake task. But I can't figure out how to setup hirb
to print the ActiveRecord
results.
task :t2 => :environment do
require 'hirb'
Hirb.enable
result = Task.select('project_id, COUNT(*) AS counter').group('project_id').order('counter DESC')
puts Hirb::Helpers::Table.render(result)
Hirb.disable
end
I've got error "Table must be an array of hashes or array of arrays"