datamapper / dm-validations

Library for performing validations on DM models and pure Ruby object
http://datamapper.org/
MIT License
50 stars 43 forks source link

The issue #44 #45

Closed ywen closed 13 years ago

ywen commented 13 years ago

in lib/dm-validations/validators/block_validator.rb:53

options = fields.last.is_a?(Hash) ? fields.last.pop.dup : {}

It seems the intention is actually

options = fields.last.is_a?(Hash) ? fields.pop.dup : {}

without last, since Hash does't have a pop method

I have fixed this and added two tests for testing it. Please let me know if it is good. Thank you

ywen commented 13 years ago

looks like it is a rewrite. Let me investigate. Thanks

ywen commented 13 years ago

yes, it's fixed. But since I don't see any tests for this. I will still make a new pull request for adding my unit tests for this if you don't mind. I will close this one.

solnic commented 13 years ago

@ywen that would be awesome, thank you!

ywen commented 13 years ago

@sonlnic already did. The latest pull request. thanks