From df5691aa94f209a59945d60d750a5040b24dbc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 11 Apr 2011 17:47:55 +0200 Subject: No need to rescue here. Invoking the wrong method in an object can happen anywhere if you are not careful. In other words, test your shit. --- activemodel/lib/active_model/validations/exclusion.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'activemodel/lib/active_model/validations/exclusion.rb') diff --git a/activemodel/lib/active_model/validations/exclusion.rb b/activemodel/lib/active_model/validations/exclusion.rb index abc1bfae78..d135d0164a 100644 --- a/activemodel/lib/active_model/validations/exclusion.rb +++ b/activemodel/lib/active_model/validations/exclusion.rb @@ -19,8 +19,6 @@ module ActiveModel if exclusions.send(inclusion_method(exclusions), value) record.errors.add(attribute, :exclusion, options.except(:in).merge!(:value => value)) end - rescue NoMethodError - raise ArgumentError, "Exclusion validation for :#{attribute} in #{record.class.name}: #{ERROR_MESSAGE}" end private -- cgit v1.2.3