rails/rails — comment on commit 85b64f98d100d37b3a232c315daa10fad37dccdc
File:  line 0
By colszowka:

@flippingbits: Actually, yes. The values in the Hash are stored in AR serialization in the format they arrive in. So if you set an integer in your tests / console you're fine. But when you're getting input from a rails form, it'll be a String because no magic typecasting happens like with proper AR attributes. The worst thing about this are Booleans. Those arrive as "1" or "" from checkboxes in the form (I think, not 100% sure) by default and therefore you need to pre-process them manually to have true/false in your settings store. So a massive +1 on explicit typecasting based upon AR's column type casting mechanisms. I think it'd be possible to give this either an array or as @kurko propsed (with wrong brackets ;) a hash so people could still screw typecasting if they'd rather bother with the mess :)