{"issue":{"state":"open","created_at":"2011-12-06T14:56:46Z","updated_at":"2011-12-06T14:56:46Z","user":{"gravatar_id":"27f96474a29b583e11fa750291b439aa","id":47516,"url":"https://api.github.com/users/jak4","login":"jak4","avatar_url":"https://secure.gravatar.com/avatar/27f96474a29b583e11fa750291b439aa?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":0,"body":"When you include Mongoid::Fields::Serializable in a class, the following code within this class will now return false instead of true: {}.is_a?(Hash)\r\n\r\nThis happens because with the inclusion of Serializable the 'nearest' Hash-Class will be 'Mongoid::Fields::Serializable::Hash'.\r\n\r\nNaturally this is not the behaviour someone would expect.\r\n\r\nThe following Code illustrates the problem:\r\n\r\n\r\n    class TestIt\r\n       include Mongoid::Fields::Serializable\r\n    \r\n       def is_hash\r\n          if( {}.is_a?(::Hash) )\r\n             puts \"hash: right\"\r\n          else\r\n             puts \"hash: wrong\"\r\n          end\r\n       end\r\n\r\n       def is_array\r\n         if( [].is_a?(Array) )\r\n           puts \"array: right\"\r\n         else\r\n           puts \"array: wrong\"\r\n         end\r\n       end\r\n    end","assignee":null,"id":2462950,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"number":1480,"title":"Serializing a custom type has Sideeffects","html_url":"https://github.com/mongoid/mongoid/issues/1480","closed_at":null,"url":"https://api.github.com/repos/mongoid/mongoid/issues/1480","milestone":null},"action":"opened"}