-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 5.1.3
-
Component/s: None
-
None
When pulling objects from the database, the 'as_document' returned hash has both symbols and strings as keys, however for in-memory documents the hash contains only string keys. For example
class Search
include Mongoid::Document
field :name, type: String
end
Search.new(name: "test").as_document["name"] => "test"
Search.new(name: "test").as_document[:name] => nil
Search.create(name: "test").as_document["name"] => "test"
Search.create(name: "test").as_document[:name] => nil
Search.first.as_document[:name] => "test"
Search.first.as_document["name"] => "test"