Skip to content
Browse files

Merge pull request #119 from c0/master

Clarification to ActiveRecord Validations Doc in 7.2 Custom Methods
  • Loading branch information...
2 parents 064ae35 + d34fd9f commit 266d844244d97363feb691baa852f50b5aa677e2 @c0 c0 committed Nov 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 guides/source/active_record_validations_callbacks.md
View
2 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

0 comments on commit 266d844

Please sign in to comment.
Something went wrong with that request. Please try again.