提交 266d8442 编写于 作者: C Caleb Wright

Merge pull request #119 from c0/master

Clarification to ActiveRecord Validations Doc in 7.2 Custom Methods
...@@ -674,7 +674,7 @@ class Invoice < ActiveRecord::Base ...@@ -674,7 +674,7 @@ class Invoice < ActiveRecord::Base
:discount_cannot_be_greater_than_total_value :discount_cannot_be_greater_than_total_value
def expiration_date_cannot_be_in_the_past 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") errors.add(:expiration_date, "can't be in the past")
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册