aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-02-19 14:14:10 +0100
committerYves Senn <yves.senn@gmail.com>2015-02-19 14:16:47 +0100
commit259d33db8cae4f139c4646077f1637a8224dfdb2 (patch)
tree4c3e10f62ae17e8419578df9cd7ef306dea3dd32 /activerecord/test/models
parentad5834f20f3749cc0f6d512d23f644c64c6bcc2c (diff)
parentfd38838f29ff0f4514b711c65cafe55c6f21ad2a (diff)
downloadrails-259d33db8cae4f139c4646077f1637a8224dfdb2.tar.gz
rails-259d33db8cae4f139c4646077f1637a8224dfdb2.tar.bz2
rails-259d33db8cae4f139c4646077f1637a8224dfdb2.zip
Merge pull request #18996 from morgoth/deprecate-more-errors-methods
Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` methods
Diffstat (limited to 'activerecord/test/models')
-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