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 eb68153bbe..4c2514b0b3 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -145,10 +145,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