localshred/protobuf — pull request #204 by wesleyk (2014-08-01 10:17:55+00:00)
Title: Stricter validation in Message#initialize for non-existent fields

My colleagues and I noticed that `Message#initialize` and `Message.encode` silently drop fields that aren't actually part of the proto. This PR makes the validation explicit, and throws a `Protobuf::FieldNotDefinedError` in that situation.

Alternatively, we could introduce backwards compatible `#initialize!` and `.encode!`. However, I think it would be a big win for this gem to enforce the schema of the protobuf to this extent.

Please take a look, and thanks for all your work for this Gem!

cc @tamird