diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-05-25 16:23:16 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-05-25 22:17:36 +0530 |
commit | 084750c2d072844d68258d4326ad3f9ae67def8e (patch) | |
tree | c97d17f2258a008581c71a355323ff3c103899d0 | |
parent | deffc9d048d652b2da9b24a60fb3244cbcd9de55 (diff) | |
download | rails-084750c2d072844d68258d4326ad3f9ae67def8e.tar.gz rails-084750c2d072844d68258d4326ad3f9ae67def8e.tar.bz2 rails-084750c2d072844d68258d4326ad3f9ae67def8e.zip |
changes validates_acceptance_of to newer syntax
-rw-r--r-- | railties/guides/source/active_record_validations_callbacks.textile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index d2616e0b8e..fdc123fdae 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/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> |