stripe/poncho — pull request #12 by dinesh (2014-11-10 18:07:48+00:00)
Title: Validation error for sub resource

It seems poncho throws an error while validating sub resources. I have following resources:

```
class CardResource < Poncho::Resource
param :number, required: true, length: 12..19
end

class EnrolledResource < Poncho::Resource
param :card, :resource => CardResource
end
```

```
enrolled = EnrolledResource.new(new(OpenStruct.new("card" => { "number" => 2 }))
enrolled.valid?
```
throws following error -

```
NoMethodError: undefined method `messages' for #<#:0x007f8133192df8>
/Users/dinesh/Desktop/poncho/lib/poncho/resource.rb:77:in `method_missing'
/Users/dinesh/Desktop/poncho/lib/poncho/params/resource.rb:17:in `block in validate_each'
/Users/dinesh/Desktop/poncho/lib/poncho/params/resource.rb:16:in `each'
/Users/dinesh/Desktop/poncho/lib/poncho/params/resource.rb:16:in `validate_each'
/Users/dinesh/Desktop/poncho/lib/poncho/params/validations.rb:12:in `validate_each'
/Users/dinesh/Desktop/poncho/lib/poncho/validator.rb:141:in `block in validate'
/Users/dinesh/Desktop/poncho/lib/poncho/validator.rb:138:in `each'
/Users/dinesh/Desktop/poncho/lib/poncho/validator.rb:138:in `validate'
/Users/dinesh/Desktop/poncho/lib/poncho/validations.rb:187:in `instance_eval'
/Users/dinesh/Desktop/poncho/lib/poncho/validations.rb:187:in `block in run_validations!'
/Users/dinesh/Desktop/poncho/lib/poncho/validations.rb:186:in `each'
/Users/dinesh/Desktop/poncho/lib/poncho/validations.rb:186:in `run_validations!'
/Users/dinesh/Desktop/poncho/lib/poncho/validations.rb:172:in `valid?'
/Users/dinesh/Desktop/poncho/test/poncho/test_resource.rb:105:in `test_sub_validation'
```