From e9e9ed6b60a42a7c3afe3c4a9f8cf6d1e5422e59 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 5 Feb 2011 16:33:00 -0800 Subject: Be able to pass a validator method to #validates --- activemodel/test/models/topic.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activemodel/test/models/topic.rb') diff --git a/activemodel/test/models/topic.rb b/activemodel/test/models/topic.rb index 2f0bb95071..8d49c1dd27 100644 --- a/activemodel/test/models/topic.rb +++ b/activemodel/test/models/topic.rb @@ -29,4 +29,8 @@ class Topic self.after_validation_performed = true end + def my_validation + errors.add :title, "is missing" unless title + end + end -- cgit v1.2.3