app/models/approval/request_form/base.rb in approval-0.3.7 vs app/models/approval/request_form/base.rb in approval-0.4.0
- old
+ new
@@ -9,14 +9,12 @@
@user = user
@reason = reason
@records = records
end
- with_options presence: true do
- validates :user
- validates :reason, length: { maximum: Approval.config.comment_maximum }
- validates :records
- end
+ validates :user, presence: true
+ validates :reason, presence: true, length: { maximum: Approval.config.comment_maximum }
+ validates :records, presence: true
def save
return false unless valid?
prepare(&:save)