activeadmin 3.5.0 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afa1c1c32021e663fdfbf9f57274716deb64f84ac184453bc2b73b6073053303
4
- data.tar.gz: 183d57d9d1d7bf90399aaeb8e46ba97077ec30f3028ead82d34d976de1cd295c
3
+ metadata.gz: be95e31901e8d39cce8d91294688462aab2b0de748a1e42ab78225a80cf3691c
4
+ data.tar.gz: 627f265f8ff2cafbae08e8e620e6a838c724c60bb3ac1d25327485587cade73f
5
5
  SHA512:
6
- metadata.gz: 6bb9e12a1b4efcf8ed33044499cffb92019ca3e5b9b81b02aa94586f142fb8f22f68e7659c01551c07d2a37fecea912cf7ac61e28c05c2e4a531b5ea74f262e2
7
- data.tar.gz: 6de75bee7cec2b1241ce989d55186a19801d272ccc4d2b06e73e022043f20e16c1781ae9ca00906681d6a2f5db22f1f6f6baa3f67b05703e2b7dacefd863f896
6
+ metadata.gz: 7a4382f75f12aa918e5a027e9f56244b9b957fc1efcce1b20faae4005406c90f328857d96ba828a9b5b4f55e364d31a529fcb8c626eeece5a95b7458eab6a795
7
+ data.tar.gz: 8f52969b691a64f6ebe7a8401fe8a5f39fc3cb745bd73b5754f6071583fd450a9d2cd4568cc64f7ae51aa536eba10e57173dffbb9c1d554137cf7d423a3ac9db
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.5.2 [☰](https://github.com/activeadmin/activeadmin/compare/v3.5.1..v3.5.2)
6
+
7
+ ### Bug Fixes
8
+
9
+ * Backport run update_resource inside a transaction to avoid autosaving relationships through assign_attributes when the record is invalid [#9064] by [@mgrunberg] and [@deivid-rodriguez]
10
+
11
+ ## 3.5.1 [☰](https://github.com/activeadmin/activeadmin/compare/v3.5.0..v3.5.1)
12
+
13
+ ### Bug Fixes
14
+
15
+ * Fix UI issue in modal dialog [#8978] by @tagliala
16
+
5
17
  ## 3.5.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.4.0..v3.5.0)
6
18
 
7
19
  ### Enhancements
@@ -1003,6 +1015,8 @@ Please check [0-6-stable] for previous changes.
1003
1015
  [#8837]: https://github.com/activeadmin/activeadmin/pull/8837
1004
1016
  [#8964]: https://github.com/activeadmin/activeadmin/pull/8964
1005
1017
  [#8965]: https://github.com/activeadmin/activeadmin/pull/8965
1018
+ [#8978]: https://github.com/activeadmin/activeadmin/pull/8978
1019
+ [#9064]: https://github.com/activeadmin/activeadmin/pull/9064
1006
1020
 
1007
1021
  [@1000ship]: https://github.com/1000ship
1008
1022
  [@5t111111]: https://github.com/5t111111
@@ -69,7 +69,9 @@
69
69
  open: function open(_event, _ui) {
70
70
  $("body").trigger("modal_dialog:after_open", [ form ]);
71
71
  },
72
- dialogClass: "active_admin_dialog",
72
+ classes: {
73
+ "ui-dialog": "active_admin_dialog"
74
+ },
73
75
  buttons: {
74
76
  OK: function OK() {
75
77
  callback($(this).serializeObject());
@@ -47,7 +47,7 @@ function ModalDialog(message, inputs, callback){
47
47
  open(_event, _ui) {
48
48
  $('body').trigger('modal_dialog:after_open', [form]);
49
49
  },
50
- dialogClass: 'active_admin_dialog',
50
+ classes: { 'ui-dialog': 'active_admin_dialog' },
51
51
  buttons: {
52
52
  OK() {
53
53
  callback($(this).serializeObject());
@@ -168,11 +168,16 @@ module ActiveAdmin
168
168
  #
169
169
  # @return [void]
170
170
  def update_resource(object, attributes)
171
- object = assign_attributes(object, attributes)
171
+ status = nil
172
+ ActiveRecord::Base.transaction do
173
+ object = assign_attributes(object, attributes)
172
174
 
173
- run_update_callbacks object do
174
- save_resource(object)
175
+ run_update_callbacks object do
176
+ status = save_resource(object)
177
+ raise ActiveRecord::Rollback unless status
178
+ end
175
179
  end
180
+ status
176
181
  end
177
182
 
178
183
  # Destroys an object from the database and calls appropriate callbacks.
@@ -68,7 +68,7 @@ module ActiveAdmin
68
68
  router.get "/#{page}", to: "#{page}#index"
69
69
  config.page_actions.each do |action|
70
70
  Array.wrap(action.http_verb).each do |verb|
71
- build_route(verb, "/#{page}/#{action.name}" => "#{page}##{action.name}")
71
+ build_route(verb, "/#{page}/#{action.name}", to: "#{page}##{action.name}")
72
72
  end
73
73
  end
74
74
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "3.5.0"
3
+ VERSION = "3.5.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh