From d911fb4f285a0038afd0eeb585e77ffae090e786 Mon Sep 17 00:00:00 2001 From: Mike Gehard Date: Wed, 9 Feb 2011 06:32:40 -0700 Subject: [PATCH] Add additional text to NotImplementedErrors [#6328 state:resolved] --- actionpack/lib/action_view/template/resolver.rb | 2 +- activemodel/lib/active_model/validator.rb | 4 ++-- .../associations/singular_association.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 4d999fb..589b2a1 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -36,7 +36,7 @@ module ActionView # because Resolver guarantees that the arguments are present and # normalized. def find_templates(name, prefix, partial, details) - raise NotImplementedError + raise NotImplementedError, "Subclasses must implement a find_templates(name, prefix, partial, details) method" end # Helpers that builds a path. Useful for building virtual paths. diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index 0168233..1bb81d8 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -122,7 +122,7 @@ module ActiveModel #:nodoc: # Override this method in subclasses with validation logic, adding errors # to the records +errors+ array where necessary. def validate(record) - raise NotImplementedError + raise NotImplementedError, "Subclasses must implement a validate(record) method." end end @@ -158,7 +158,7 @@ module ActiveModel #:nodoc: # Override this method in subclasses with the validation logic, adding # errors to the records +errors+ array where necessary. def validate_each(record, attribute, value) - raise NotImplementedError + raise NotImplementedError, "Subclasses must implement a validate_each(record, attribute, value) method" end # Hook method that gets called by the initializer allowing verification diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index 7f92d97..cf4cb2a 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -21,7 +21,7 @@ module ActiveRecord # Implemented by subclasses def replace(record) - raise NotImplementedError + raise NotImplementedError, "Subclasses must implement a replace(record) method" end def set_new_record(record) -- 1.7.3.4