From d1374f99bf3090f3e659687c112ed0c5c0865cfb Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 27 Oct 2014 17:28:53 +0100 Subject: Pass symbol as an argument instead of a block --- activerecord/lib/active_record/validations/presence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/presence.rb b/activerecord/lib/active_record/validations/presence.rb index c7aa814ba8..61b30749d9 100644 --- a/activerecord/lib/active_record/validations/presence.rb +++ b/activerecord/lib/active_record/validations/presence.rb @@ -8,7 +8,7 @@ module ActiveRecord associated_records = Array.wrap(record.send(attribute)) # Superclass validates presence. Ensure present records aren't about to be destroyed. - if associated_records.present? && associated_records.all? { |r| r.marked_for_destruction? } + if associated_records.present? && associated_records.all?(&:marked_for_destruction?) record.errors.add(attribute, :blank, options) end end -- cgit v1.2.3