Permalink
Browse files

changes validates_acceptance_of to newer syntax

  • Loading branch information...
1 parent deffc9d commit 084750c2d072844d68258d4326ad3f9ae67def8e @vijaydev vijaydev committed May 25, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/guides/source/active_record_validations_callbacks.textile
@@ -171,7 +171,7 @@ Validates that a checkbox on the user interface was checked when a form was subm
<ruby>
class Person < ActiveRecord::Base
- validates_acceptance_of :terms_of_service
+ validates :terms_of_service, :acceptance => true
end
</ruby>
@@ -181,7 +181,7 @@ The default error message for +validates_acceptance_of+ is "_must be accepted_".
<ruby>
class Person < ActiveRecord::Base
- validates_acceptance_of :terms_of_service, :accept => 'yes'
+ validates :terms_of_service, :acceptance => true, :accept => 'yes'
end
</ruby>

0 comments on commit 084750c

Please sign in to comment.