From 465e0c0c2635588927ca707e6220cd7f232b3f17 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 7 Dec 2004 12:18:33 +0000 Subject: Added the possibility of having validate be protected for assert_(in)valid_column #263 [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@67 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/active_record_assertions_test.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'actionpack/test/controller/active_record_assertions_test.rb') diff --git a/actionpack/test/controller/active_record_assertions_test.rb b/actionpack/test/controller/active_record_assertions_test.rb index 53106aaee7..2a005b8586 100644 --- a/actionpack/test/controller/active_record_assertions_test.rb +++ b/actionpack/test/controller/active_record_assertions_test.rb @@ -21,11 +21,12 @@ require 'fixtures/company' # add some validation rules to trip up the assertions class Company - def validate - errors.add_on_empty('name') - errors.add('rating', 'rating should not be 2') if rating == 2 - errors.add_to_base('oh oh') if rating == 3 - end + protected + def validate + errors.add_on_empty('name') + errors.add('rating', 'rating should not be 2') if rating == 2 + errors.add_to_base('oh oh') if rating == 3 + end end # ----------------------------------------------------------------------------- -- cgit v1.2.3