aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/info_request.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index aed49bc21..3ee1c3c08 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -1140,8 +1140,13 @@ public
private
def set_defaults
- if self.described_state.nil?
- self.described_state = 'waiting_response'
+ begin
+ if self.described_state.nil?
+ self.described_state = 'waiting_response'
+ end
+ rescue ActiveModel::MissingAttributeError
+ # this should only happen on Model.exists?() call. It can be safely ignored.
+ # See http://www.tatvartha.com/2011/03/activerecordmissingattributeerror-missing-attribute-a-bug-or-a-features/
end
# FOI or EIR?
if !self.public_body.nil? && self.public_body.eir_only?