From 1bce43d6a51ee09631f55cf427a2e110d901ecb2 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 2 Oct 2017 16:54:33 +0200 Subject: Don't validate again when checking if valid. Unless validation has not yet been performed, of course. --- lib/contact.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/contact.rb') diff --git a/lib/contact.rb b/lib/contact.rb index d5fd267..0a7a449 100644 --- a/lib/contact.rb +++ b/lib/contact.rb @@ -17,7 +17,7 @@ class Contact end def valid? - validate! + validate! unless @errors @errors.length == 0 end -- cgit v1.2.3