{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/8ab675ae2f4963ed0d6c6f1a6e302265?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"8ab675ae2f4963ed0d6c6f1a6e302265","url":"https://api.github.com/users/gorkunov","login":"gorkunov","id":378207},"assignee":null,"updated_at":"2011-11-01T08:54:04Z","labels":[],"comments":3,"closed_at":"2011-10-31T21:13:38Z","url":"https://api.github.com/repos/mongoid/mongoid/issues/1389","body":"**Affected versions:**  2.1.9,  2.2.4\r\n**ruby:** ruby-1.9.2-p290\r\n\r\n```ruby\r\nclass Foo\r\n  include Mongoid::Document\r\n  field :somefield\r\n  embedded_in :bar\r\nend\r\nclass Bar\r\n  include Mongoid::Document\r\n  \r\n  field :str\r\n  validates_presence_of :str\r\n\r\n  embeds_one :foo\r\n  validates_presence_of :foo\r\nend    \r\n\r\n>> Bar.create.errors\r\n=> {:str=>[\"can't be blank\"], :foo=>[\"can't be blank\"]}\r\n\r\n>> Bar.create({:str => \"\"}).errors\r\n=> {:str=>[\"can't be blank\"], :foo=>[\"can't be blank\"]}\r\n\r\n>> Bar.create({:str => \"\", :foo => \"\" }).errors\r\nNoMethodError: undefined method `metadata' for \"\":String\r\n\tfrom /Users/gorkunov/.rvm/gems/ruby-1.9.2-p290/gems/mongoid-2.1.9/lib/mongoid/relations/proxy.rb:115:in `characterize_one'\r\n\r\n```","html_url":"https://github.com/mongoid/mongoid/issues/1389","number":1389,"title":"validates_presence_of allow empty string for embeds documents","id":2095394,"created_at":"2011-10-31T10:13:41Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/f8a3d29e1386d03e70a061764d738407?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f8a3d29e1386d03e70a061764d738407","url":"https://api.github.com/users/tmaier","login":"tmaier","id":350038},"updated_at":"2011-11-01T08:54:04Z","url":"https://api.github.com/repos/mongoid/mongoid/issues/comments/2588038","body":"Wehre it passes the validation?\r\nI just see a NoMethodError, which means it failed already before validating the object. (actually when building the relation)","id":2588038,"created_at":"2011-11-01T08:54:04Z"}}