aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/company.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/company.rb')
-rw-r--r--activerecord/test/models/company.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index 02a775f9ef..9c9d03dd5b 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -146,10 +146,13 @@ class Account < ActiveRecord::Base
true
end
+ validate :check_empty_credit_limit
+
protected
- def validate
- errors.add_on_empty "credit_limit"
- end
+
+ def check_empty_credit_limit
+ errors.add_on_empty "credit_limit"
+ end
private