diff options
author | Carl Lerche <me@carllerche.com> | 2011-02-05 16:33:00 -0800 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2011-02-05 16:33:00 -0800 |
commit | e9e9ed6b60a42a7c3afe3c4a9f8cf6d1e5422e59 (patch) | |
tree | e9d45b2dd7c00979fcc5bd36ce430ac5406c3bb0 /activemodel/test/models | |
parent | ed7614aa7de2eaeba16c9af11cf09b4fd7ed6819 (diff) | |
download | rails-e9e9ed6b60a42a7c3afe3c4a9f8cf6d1e5422e59.tar.gz rails-e9e9ed6b60a42a7c3afe3c4a9f8cf6d1e5422e59.tar.bz2 rails-e9e9ed6b60a42a7c3afe3c4a9f8cf6d1e5422e59.zip |
Be able to pass a validator method to #validates
Diffstat (limited to 'activemodel/test/models')
-rw-r--r-- | activemodel/test/models/topic.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |