mongoid/mongoid — Issue #1493: `fields` returns empty string instead of field info
Author: haihappen
Created: 2011-12-12 16:38:25+00:00
State: open

I have following classes and modules:

```ruby
# user.rb
class User
include Basic::Auth
end

# basic/auth.rb
module Basic::Auth
extend ActiveSupport::Concern

included do
field :username, type: EncryptedString
field :password, type: EncryptedString
end
end

# encrypted_string.rb
class EncryptedString < String
include Mongoid::Fields::Serializable

def deserialize(value)
Gibberish::AES.new(ENV['AES_KEY']).decrypt(value)
end

def serialize(value)
Gibberish::AES.new(ENV['AES_KEY']).encrypt(value)
end
end
```

Following snippet returns an empty string, why?

```ruby
User.fields['username']
# => ""
```