aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorWojciech Wnętrzak <w.wnetrzak@gmail.com>2015-02-18 23:04:16 +0100
committerWojciech Wnętrzak <w.wnetrzak@gmail.com>2015-02-19 14:10:38 +0100
commitfd38838f29ff0f4514b711c65cafe55c6f21ad2a (patch)
treedea03ed3df1c23dcbe0989a86fdcb0021323836a /activerecord/test
parent39c936b7605ac90c7e9643792cfe891a2d1afbf3 (diff)
downloadrails-fd38838f29ff0f4514b711c65cafe55c6f21ad2a.tar.gz
rails-fd38838f29ff0f4514b711c65cafe55c6f21ad2a.tar.bz2
rails-fd38838f29ff0f4514b711c65cafe55c6f21ad2a.zip
Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` methods
without replacement.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/models/company.rb2
-rw-r--r--activerecord/test/models/company_in_module.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index 5a56616eb9..6961f8fd6f 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -214,7 +214,7 @@ class Account < ActiveRecord::Base
protected
def check_empty_credit_limit
- errors.add_on_empty "credit_limit"
+ errors.add("credit_limit", :blank) if credit_limit.blank?
end
private
diff --git a/activerecord/test/models/company_in_module.rb b/activerecord/test/models/company_in_module.rb
index dae102d12b..bf0a0d1c3e 100644
--- a/activerecord/test/models/company_in_module.rb
+++ b/activerecord/test/models/company_in_module.rb
@@ -91,7 +91,7 @@ module MyApplication
protected
def check_empty_credit_limit
- errors.add_on_empty "credit_limit"
+ errors.add("credit_card", :blank) if credit_card.blank?
end
end
end