Rails Rails validation with Themis

greyblake · 2013年08月21日 · 最后由 nightire 回复于 2013年08月21日 · 2239 次阅读

We've open sourced Themis: https://github.com/TMXCredit/themis It's a library which makes validation in rails a little bit more flexible(e.g. you need to apply different validations on a model graph depending on context).

And here is article how to use it: http://greyblake.com/blog/2013/08/19/validation-in-rails-with-themis/ Also I showed in article alternative approaches to solve similar problems.

Thanks, and sorry for English. One day I'll speak Chinese, I promise! :-)

Nice work! Although, there seems to be a few instances of method_missing, I'm not sure if I like this approach... :/

Datamappify also composes validation rules, by using a different approach: https://github.com/fredwu/datamappify/blob/master/lib/datamappify/entity/composable/validators.rb

国际友人啊?

fredwu, thanks for Datamappify! Looks interesting.

在中国工作的国际友人吗?顶一下!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号