{"issue":{"created_at":"2011-12-01T15:43:51Z","state":"closed","updated_at":"2011-12-09T11:50:50Z","comments":3,"user":{"gravatar_id":"27a0811a9ca3c1ed3f41046159824c84","id":24801,"url":"https://api.github.com/users/christianhellsten","avatar_url":"https://secure.gravatar.com/avatar/27a0811a9ca3c1ed3f41046159824c84?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"christianhellsten"},"body":"The following method definition in your model:\r\n```def metadata\r\n...\r\nend\r\n```\r\n\r\nwill result in this error when trying to set the field to a Hash object:\r\n```    undefined method `path' for {}:Hash\r\n(eval):2:in `method_missing'\r\n(eval):2:in `method_missing'\r\n.../gems/mongoid-2.3.4/lib/mongoid/atomic.rb:210:in `atomic_paths'\r\n.../gems/mongoid-2.3.4/lib/mongoid/atomic.rb:148:in `atomic_selector'\r\n.../gems/mongoid-2.3.4/lib/mongoid/persistence/operations.rb:117:in `selector'\r\n```\r\n\r\nFor example, with this code:\r\n```doc = Document.first\r\ndoc.metadata = {:one => 1} # or doc.update_attribute...\r\ndoc.save\r\n```","assignee":null,"id":2415929,"labels":[{"name":"bug","color":"e10c02","url":"https://api.github.com/repos/mongoid/mongoid/labels/bug"},{"name":"confirmed","color":"e10c02","url":"https://api.github.com/repos/mongoid/mongoid/labels/confirmed"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":1467,"title":"Defining a method named \"metadata\" breaks mongoid","closed_at":"2011-12-09T11:50:50Z","html_url":"https://github.com/mongoid/mongoid/issues/1467","url":"https://api.github.com/repos/mongoid/mongoid/issues/1467","milestone":{"created_at":"2011-10-06T16:38:59Z","state":"open","due_on":"2011-12-12T08:00:00Z","closed_issues":20,"creator":{"gravatar_id":"6f09262a13427532461b0b618d445b1e","id":9030,"url":"https://api.github.com/users/durran","avatar_url":"https://secure.gravatar.com/avatar/6f09262a13427532461b0b618d445b1e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"durran"},"number":27,"title":"2.4.0","description":"","open_issues":22,"url":"https://api.github.com/repos/mongoid/mongoid/milestones/27"}},"action":"closed"}