Handle trailing newline in default strings #69

merged 1 commit into from Oct 31, 2012

2 participants


I ran into this when trying to use ActiveRecord's Array serialization. Since the tweak_default regexes were only matching against non-newline characters, newlines in the default value for a string column mean you get hosed with ActiveRecord::SerializationTypeMismatch. This is since sqlite3 thinks the default value is "'--- []\n'" instead of "--- []\n".

I'm happy to change things about this patch if there are tweaks :trollface: you'd like to see. Let me know.

@tenderlove tenderlove merged commit f87d5bc into sparklemotion:master Oct 31, 2012
@trptcolin trptcolin deleted the trptcolin:trailing_newline_defaults branch Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment