diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-09 14:37:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-09 14:37:37 +0000 |
commit | 27ea0b527e172bbc8f8b68c39c8359ee0c77e435 (patch) | |
tree | 00f76609affbfd723213e2298158410526614fe0 /activerecord/CHANGELOG | |
parent | d33f814db500538cee14b3db83afaef5f671a692 (diff) | |
download | rails-27ea0b527e172bbc8f8b68c39c8359ee0c77e435.tar.gz rails-27ea0b527e172bbc8f8b68c39c8359ee0c77e435.tar.bz2 rails-27ea0b527e172bbc8f8b68c39c8359ee0c77e435.zip |
Added Base.validate_confirmation that encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@97 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r-- | activerecord/CHANGELOG | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 7c12ad482e..6299d386f4 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -17,6 +17,22 @@ NOTE: This validation is only happening on create. When you want to update the record, you'll have to decide and pursue your own course of action. + +* Added Base.validate_confirmation that encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). Example: + + Model: + class Person < ActiveRecord::Base + validate_acceptance :terms_of_service + end + + View: + <%= check_box "person", "terms_of_service" %> + + The terms_of_service attribute is entirely virtual. It's only used for validation at the time of creation. No database column is needed. + + NOTE: The agreement is considered valid if it's set to the string "1". This makes it easy to relate it to an HTML checkbox. + + * Added validation macros to make the stackable just like the lifecycle callbacks. Examples: class Person < ActiveRecord::Base |