Question: I was able to figure out how to produce a random alphanumeric string after refreshing my Java Knowledge. Here is a my method:

```
private static final String ALPHA_NUMERIC_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

 String idGenerator(int count){
        StringBuilder builder = new StringBuilder();

        while (count-- != 0) {

            int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());

            builder.append(ALPHA_NUMERIC_STRING.charAt(character));

        }

        return builder.toString();
}

```

However, I was wondering how many possible combinations of string can my `idGenerator` method produce? Is there a built in method, class or a possible algorithm to determine this? Thanks!

Answer: 
I had the same error. 

> 
> TypeError: can't cast Array to
> 
> 
> 

As said in documentation <https://github.com/carrierwaveuploader/carrierwave#multiple-file-uploads> you need do migration

```
rails g migration add_avatars_to_users avatars:json

```

The problem is in type column *json*. SQLite3 and MySQL have not this type as it in PostgreSQL. You can migrate it as *text* 

```
rails g migration add_avatars_to_users avatars:text

```

For me it's work.
Same error with sqlite3:

Put this in your Model:

```
serialize :avatars, Array

```