8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ed19fc commit a12c203Copy full SHA for a12c203
app/controllers/active_admin/resource_controller/data_access.rb
@@ -168,11 +168,16 @@ def save_resource(object)
168
#
169
# @return [void]
170
def update_resource(object, attributes)
171
- object = assign_attributes(object, attributes)
+ status = nil
172
+ ActiveRecord::Base.transaction do
173
+ object = assign_attributes(object, attributes)
174
- run_update_callbacks object do
- save_resource(object)
175
+ run_update_callbacks object do
176
+ status = save_resource(object)
177
+ raise ActiveRecord::Rollback unless status
178
+ end
179
end
180
+ status
181
182
183
# Destroys an object from the database and calls appropriate callbacks.
0 commit comments