diff options
author | Henare Degan <henare.degan@gmail.com> | 2012-12-11 17:58:18 +1100 |
---|---|---|
committer | Henare Degan <henare.degan@gmail.com> | 2012-12-11 17:58:18 +1100 |
commit | 447e4afe27a6243b05b760dd2c0a7ffcdaa0d56e (patch) | |
tree | 91d16b1a9e9cc6d81dd070aa4e34fa0d065e05b1 | |
parent | c1db6959df06ba07b71213f3a281d4c5be38572f (diff) |
Add the error to each attribute which would display the error next to each input field
-rw-r--r-- | app/models/censor_rule.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb index 6eeef8482..ec66074b7 100644 --- a/app/models/censor_rule.rb +++ b/app/models/censor_rule.rb @@ -39,7 +39,9 @@ class CensorRule < ActiveRecord::Base def require_user_request_or_public_body if self.info_request.nil? && self.user.nil? && self.public_body.nil? - errors.add("Censor must apply to an info request a user or a body; ") + [:info_request, :user, :public_body].each do |a| + errors.add(a, "Rule must apply to an info request, a user or a body") + end end end |