Remove duplication in Ruby map with conditional entries
This is just a rough thought, so it's untested, but here goes:

A vast majority of the hash is the same every time. So, that vast majority can be stuck into a method. There are two fields that are conditionally added to that hash based on their values ('true' or... not). So, we can create a method which takes a record as an argument and the two 'true'/not options and generates a hash accordingly:

def record_for(record, status: false, requested_by: false)
  record_hash = {
    warning: as_warning(record),
    updated_at: as_time_ago(record.updated_at),
    manager: record.manager.nil? ? "" : record.manager.formal_name,
    first_date: as_date(record.first_date),
    last_date: as_date(record.last_date),
    days: as_number(record.total_days),
    hours: as_number(record.total_hours),
    units: as_number(record.total_units),
    value: as_number(record.total_value),
    comment: as_comment(record.comment),
    actions: as_actions(record)
  }
  record_hash[:status] = as_status(record.status) if status
  record_hash[:user] = record.user.nil? ? "" : record.user.formal_name if requested_by
  record_hash
end


Then, all that remains is to convert the strings to booleans:

def to_bool(str)
  return true if str == 'true'
  false
end


and then iterate over the records:

status = to_bool(show_status)
requested_by = to_bool(show_requested_by)

records.map { |r| record_for(r, status: status, requested_by: requested_by) }


I'd be happy to go more in depth and test the code if you provided a set of test records that I could use or some larger context this code would run in.