mongoid/mongoid — Issue #1491: Error on localized fields without default values
Author: tiagogodinho
Created: 2011-12-11 00:15:33+00:00
State: open

The code works fine in **2.3.4**, but in **master** branch broke because it need a default value.

```ruby
class Post
include Mongoid::Document

field :title, localize: true
end

post = Post.new
post.title # return an error on deserialize
```
When I add `default: ""` works fine.

```ruby
post = Post.new
post.title_translations # => { "en" => "" }
```

I'd like if localized fields return `{ "en" => nil }` if no default is provided.

```ruby
post = Post.new
post.title_translations # => { "en" => nil }
```

I work on this feature, but I need to know if this is good for all.

Thanks.