diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-03-22 15:06:24 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-03-22 15:06:24 +1100 |
commit | 0078c3d4eacb3107766a057a42644b9066f15c4a (patch) | |
tree | c62af61b4eedf3f6ac4430f88a40b12af9b1945a /app/models/info_request.rb | |
parent | ca4ae410e70ab490ae4c8cad8839f41783c89ef7 (diff) |
Wrap in a transaction
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 83a57b4b2..f63c10e0a 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -557,9 +557,11 @@ public # Report this request for administrator attention def report!(reason, message, user) - set_described_state('attention_requested', user, "Reason: #{reason}\n\n#{message}") - self.attention_requested = true # tells us if attention has ever been requested - save! + ActiveRecord::Base.transaction do + set_described_state('attention_requested', user, "Reason: #{reason}\n\n#{message}") + self.attention_requested = true # tells us if attention has ever been requested + save! + end end # change status, including for last event for later historical purposes |