# Fixtures Munging Data?

**URL:** <https://www.ruby-forum.com/t/fixtures-munging-data/125047>\
**Category:** Rails\
**Created:** [January 4, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/fixtures-munging-data/125047 "2008-01-04T20:55:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 4, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/fixtures-munging-data/125047/1 "2008-01-04T20:55:42Z")

</div>

I export all my dev data into yaml files so that they can be version  
controlled along with the migrations. On one of my tables I have a  
MySQL varchar field called ‘name’. The yaml file for that table had  
numerical values populating name. So when it gets imported back into  
the DB with Fixtures.create\_fixtures the data is getting munged. If  
the name field contains only digits, then it is being converted to  
hex. One name field Contained “0101” and it goes into the database as  
65. If i modify the yaml file and stick a letter in front (so,  
“a0101”) it goes up just fine.  
I ran this from the console and the Fixture command is returning the  
converted values.

I would rather not change the field type, because there is a distinct  
possibility it will contain non numerical data.

Has anyone run across this before?

Thanks,  
C.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 4, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/fixtures-munging-data/125047/2 "2008-01-04T20:56:52Z")

</div>

almost forgot…I am running Rails 2.0.1

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 6, 2008, 5:45am UTC](https://www.ruby-forum.com/t/fixtures-munging-data/125047/3 "2008-01-06T05:45:31Z")

</div>

Quoting C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I ran this from the console and the Fixture command is returning the  
> converted values.

Enclose the value in quotes and it will always be interpreted as a  
string.

HTH,  
Jeffrey
