Yan Pritzker photographer, entrepreneur, software engineer, musician, skier

Blog :: Git Workflows Book :: Dotfiles :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

I am a photographer, entrepreneur, software engineer, guitarist, climber, and telemark skier

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Enterprise intelligence with prediction markets

Find out what your team, colleagues and partners really know about the future — and leverage their knowledge to improve business decisions.

I'm the founder of Planypus, the place to share your plans!

Archives

Contact

Reach me at yan at pritzker.ws

validates_acceptance_of behavior in Rails 2.0

Posted 21 February 2008 @ 6pm | Tagged RubyOnRails


Submit to HN

I noticed that when upgrading to Rails 2.0, my validates_acceptance_of started failing (or rather, it started telling me that my field was not accepted when the param being passed was ’1′). Apparently I had to add the :accept => true to make it work. I discovered this by reading the Rails source, where it mentions that database columns will be converted to true/false so you must have this if you’re validating on a real database column


validates_acceptance_of :terms_of_service, :allow_nil => false, :accept => true

2 Comments

Posted by
asterisk
31 May 2009 @ 7pm

thanks, this worked great. Learning RoR from a book using 1.8.x as it’s basis is a bit challenging, but thanks to posts like this, I’m able to figure out what’s what.


Posted by
ijan
17 January 2010 @ 7pm

Oh my. You just fixed two hours of confusion.

Thank you!


Leave a Comment