acts_as_audited - save NAME value not ID value

I have a form with many fields that can be changed. Company, Group,
Facility, Department, User, etc...

Each field has an associated table with the following fields(ID, NAME)

If a Company, Group, or Department is changed, the 'CHANGES' text
field of the 'AUDITS' table stores something like the following:

I have a form with many fields that can be changed. Company, Group,
Facility, Department, User, etc...

Each field has an associated table with the following fields(ID, NAME)

If a Company, Group, or Department is changed, the 'CHANGES' text
field of the 'AUDITS' table stores something like the following:
---
company_id:
- 111
- 222
group_id:
- 333
- 444
department_id:
- 555
- 777

This is what will show in my VIEW:
company_id - 111 - 222
group_id - 333 - 444
department_id - 555 - 777

Instead of storing the ID, I want to store the actual NAME value so I
can display something like the following in my VIEW:
company_id - ABC COMPANY - XYZ COMPANY
group_id - RED GROUP - GREEN GROUP
department_id - ACCOUNTING - PAYROLL

Anyone have any ideas on how this could be accomplished?

Frank_in_Tennessee wrote:

I have a form with many fields that can be changed. Company, Group,
Facility, Department, User, etc...

Each field has an associated table with the following fields(ID, NAME)

If a Company, Group, or Department is changed, the 'CHANGES' text
field of the 'AUDITS' table stores something like the following:
---
company_id:
- 111
- 222
group_id:
- 333
- 444
department_id:
- 555
- 777

This is what will show in my VIEW:
company_id - 111 - 222
group_id - 333 - 444
department_id - 555 - 777

Instead of storing the ID, I want to store the actual NAME value so I
can display something like the following in my VIEW:
company_id - ABC COMPANY - XYZ COMPANY
group_id - RED GROUP - GREEN GROUP
department_id - ACCOUNTING - PAYROLL

Anyone have any ideas on how this could be accomplished?

Don't do that. Keep the data stored as ids in the DB, and get the names
out of the appropiate table. If you do one query for all names, there
shouldn't be too much performance degradation.

Thanks,

Frank

Best,