Permalink
Browse files

Easy dependent_restrict error message

  • Loading branch information...
1 parent 336ff8a commit 38ffca55ab806990b35f23b44540f9eef90461c1 @pacoguzman pacoguzman committed with Manoj Jan 29, 2012
@@ -60,8 +60,7 @@ def define_restrict_dependency_method
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
@@ -60,8 +60,7 @@ def define_restrict_dependency_method
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

0 comments on commit 38ffca5

Please sign in to comment.