diff options
author | Caleb Wright <caleb.wright@gmail.com> | 2012-11-25 20:59:35 -0800 |
---|---|---|
committer | Caleb Wright <caleb.wright@gmail.com> | 2012-11-25 20:59:35 -0800 |
commit | 266d844244d97363feb691baa852f50b5aa677e2 (patch) | |
tree | 9bd635dfdb6ba92fa190de7c0a4762a3a4b67b1b /guides/source | |
parent | 064ae350dc8764dd10f2274a4293780b0210339c (diff) | |
parent | d34fd9fd826fb658cb348eacf8b9edfce06f2b3d (diff) | |
download | rails-266d844244d97363feb691baa852f50b5aa677e2.tar.gz rails-266d844244d97363feb691baa852f50b5aa677e2.tar.bz2 rails-266d844244d97363feb691baa852f50b5aa677e2.zip |
Merge pull request #119 from c0/master
Clarification to ActiveRecord Validations Doc in 7.2 Custom Methods
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_record_validations_callbacks.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/active_record_validations_callbacks.md b/guides/source/active_record_validations_callbacks.md index 0f4140b650..28f693a856 100644 --- a/guides/source/active_record_validations_callbacks.md +++ b/guides/source/active_record_validations_callbacks.md @@ -674,7 +674,7 @@ class Invoice < ActiveRecord::Base :discount_cannot_be_greater_than_total_value def expiration_date_cannot_be_in_the_past - if !expiration_date.blank? and expiration_date < Date.today + if expiration_date.present? && expiration_date < Date.today errors.add(:expiration_date, "can't be in the past") end end |