# MySQL set data type

**URL:** <https://www.ruby-forum.com/t/mysql-set-data-type/104366>\
**Category:** Rails\
**Created:** [May 17, 2007, 6:57am UTC](https://www.ruby-forum.com/t/mysql-set-data-type/104366 "2007-05-17T06:57:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliotlarson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e9c0ed/32.png) [@elliotlarson](https://www.ruby-forum.com/u/elliotlarson)\
**Post date:** [May 17, 2007, 6:57am UTC](https://www.ruby-forum.com/t/mysql-set-data-type/104366/1 "2007-05-17T06:57:56Z")

</div>

I have a legacy database table I’m working with in Rails and one of  
the fields is the MySQL set field type, like so:

`userRoles` set(‘CEO’,‘President’,‘Vice President’,‘Sales Manager’)

When I access the table with Active Record I only get an integer value  
for this field, which I think is the raw format MySQL uses to store  
the set values. Does anyone know how to retrieve this field type in  
its human readable format, using Active Record?
