rails/rails — pull request #10043 by cconstantine (2013-04-02 07:01:38+00:00)
Title: DB with postgres string array column doesn't load fixtures well

I have a rails4 app that uses a model with a string array column. When I have a fixture that includes a string with a ' (single-quote) mark I get a syntax error when the fixtures attempt to load.

To reproduce:

git clone https://github.com/cconstantine/wattle/tree/use_fixtures
cd wattle
rspec

You can see an example of the exception output I see at:
https://gist.github.com/cconstantine/d4df1f2b29f92058badc

I'ave attached a commit that fixes it for me (although master appears to be broken right now). I'm not sure if that's the best way to approach the problem, but it works for me and doesn't break any tests. I'm not sure why the normal escaping for the array value doesn't work.

Thanks