diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2012-01-29 12:31:37 +0100 |
---|---|---|
committer | Manoj <manoj.kumar@risingsuntech.net> | 2012-01-31 14:09:18 +0530 |
commit | 38ffca55ab806990b35f23b44540f9eef90461c1 (patch) | |
tree | c632d3246fee7b9ae8e57e5825f015c378a26e4a /activerecord/lib/active_record | |
parent | 336ff8a97e9391d4111e923a9b841376110d04c9 (diff) | |
download | rails-38ffca55ab806990b35f23b44540f9eef90461c1.tar.gz rails-38ffca55ab806990b35f23b44540f9eef90461c1.tar.bz2 rails-38ffca55ab806990b35f23b44540f9eef90461c1.zip |
Easy dependent_restrict error message
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/has_many.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/builder/has_one.rb | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/builder/has_many.rb b/activerecord/lib/active_record/associations/builder/has_many.rb index 0fe32b5f16..7d85f3fdb2 100644 --- a/activerecord/lib/active_record/associations/builder/has_many.rb +++ b/activerecord/lib/active_record/associations/builder/has_many.rb @@ -60,8 +60,7 @@ module ActiveRecord::Associations::Builder if dependent_restrict_raises? raise ActiveRecord::DeleteRestrictionError.new(name) else - errors.add(:base, I18n.t("activerecord.errors.messages.restrict_dependent_destroy", - :model => name)) + errors.add(:base, :restrict_dependent_destroy, :model => name) return false end end diff --git a/activerecord/lib/active_record/associations/builder/has_one.rb b/activerecord/lib/active_record/associations/builder/has_one.rb index d9fed4b7f2..9187f111a2 100644 --- a/activerecord/lib/active_record/associations/builder/has_one.rb +++ b/activerecord/lib/active_record/associations/builder/has_one.rb @@ -60,8 +60,7 @@ module ActiveRecord::Associations::Builder if dependent_restrict_raises? raise ActiveRecord::DeleteRestrictionError.new(name) else - errors.add(:base, I18n.t("activerecord.errors.messages.restrict_dependent_destroy", - :model => name)) + errors.add(:base, :restrict_dependent_destroy, :model => name) return false end end |