<p>I want to save a set of email addresses collected from a text field (separated by commas) into a single field in a table. I am trying to use serialize but I'm getting SerializationTypeMismatch error. How can I do this?</p>

<p>This is my model:</p>

<p>class Crew &lt; ActiveRecord::Base</p>

<p>class Recipients &lt; HashWithIndifferentAccess ; end</p>

<p>serialize :recipients, Recipients</p>

<p>end</p>

I would really reccomend that you parse (e.g. split on comma) the email list and put each in a row in a separate table (I assume you're talkin about a database table?). If you want to use the email addresses for something it's better to store them individually, and since you're talking about serialization I guess you've allready parsed the emails, and try to store an array or similar into a single field in a database. The "correct" normalized database way of doing this is to in your model wich you're currently trying to save the object, add a
```
has_many :emails
```
(or similar) and creat a new email table for each email.
One should allways have a very
good reason
for storing list type data in a blob, instead of using a proper associated table.