From fd38838f29ff0f4514b711c65cafe55c6f21ad2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Wn=C4=99trzak?= Date: Wed, 18 Feb 2015 23:04:16 +0100 Subject: Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` methods without replacement. --- activerecord/test/models/company.rb | 2 +- activerecord/test/models/company_in_module.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test') 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 -- cgit v1.2.3