From 7892b717a801e40ee4db1ac6622d844ae6998132 Mon Sep 17 00:00:00 2001 From: Joe Francis Date: Mon, 5 Jun 2017 11:34:40 -0500 Subject: Remove deprecated passing of string to :if/:unless (#29357) Other examples were removed in 53ff5fc62f9d11b6f60d371df959137f4bf40728 [ci skip] --- guides/source/active_record_validations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index 5313361dfd..6eb5de78be 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -953,7 +953,7 @@ should happen, an `Array` can be used. Moreover, you can apply both `:if` and ```ruby class Computer < ApplicationRecord validates :mouse, presence: true, - if: ["market.retail?", :desktop?], + if: [Proc.new { |c| c.market.retail? }, :desktop?], unless: Proc.new { |c| c.trackpad.present? } end ``` -- cgit v1.2.3