activeadmin 3.2.5 → 3.4.0

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: 99b9db7d0e925b5764b5141008734fa147cbb742e0f3e62476a7dcc8fb1f0485
4
- data.tar.gz: b0f5aa9c2dc4c1923e7cac2b893a0a2d871ddb67cdec7183dc7886b5adea97e6
3
+ metadata.gz: 3421560bc8ebcddcb2685e3a296c5dbecd08d53f90c858f747dd57729e63136b
4
+ data.tar.gz: 53a03320dfd11b59d81392a942a138d84c50403119f2f8007700e433a1ac32db
5
5
  SHA512:
6
- metadata.gz: efa9d0ded1ac54f680ab3409019cf425a578d18bd89c73b4a39cc219cbbb50e25abeb294d771724394648432704e5bbcb10729ea5aa4e89150c00c3de876755d
7
- data.tar.gz: c85cd6bfc4f4cbaa4345d960c8c797ab4066d58f131116b79100195edd6e269ac8f1867441442801c7a7eea4cefebe36506db373284d28b7ee48fa826d05bdcc
6
+ metadata.gz: 25514fe7c810b5df4cd6f91fb5af09f1997d67a0b350003d47c1d3a9bb7c8a4e240045c83a32c07c6207e79a2d3ff29ddbffb0d73801751b8b6f1b0defa354ec
7
+ data.tar.gz: 338c4417858bd84fa539e983c841412d8ebeab3ae1c069410fa015bfc1b5f16506f73d05f3b3e5e95462d1a899d9451359496eddfb519cd33f23d09fd93c9bfc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.4.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.3.0..v3.4.0)
6
+
7
+ * Add Rails 8.1 compatibility and drop Ruby < 3.0 support [#8837] by [@tagliala]
8
+
9
+ ## 3.3.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.5..v3.3.0)
10
+
11
+ ### Enhancements
12
+
13
+ * Improve v3 docs regarding compatibility with vite_rails [#8548] by [@mattbrictson]
14
+ * Backport test against Rails 8.0 [#8556] by [@mgrunberg] and [@tagliala]
15
+ * Test against Ruby 3.4 [#8614] by [@tagliala]
16
+ * Backport Support sortable argument in id_column [#8650] by [@jaynetics]
17
+ * Backport Support title for id_column [#8652] by [@mgrunberg]
18
+
19
+ ### Bug Fixes
20
+
21
+ * Backport Fix attributes passed to form has_many not being set on new record form items [#8551] by [@Fs00]
22
+ * Backport Fix deprecation warning in Ruby 3.4 [#8596] by [@tagliala]
23
+ * Backport Fix circular require warning in belongs_to.rb [#8601] by [@tagliala]
24
+
5
25
  ## 3.2.5 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.4..v3.2.5)
6
26
 
7
27
  ### Enhancements
@@ -960,6 +980,15 @@ Please check [0-6-stable] for previous changes.
960
980
  [#8468]: https://github.com/activeadmin/activeadmin/pull/8468
961
981
  [#8469]: https://github.com/activeadmin/activeadmin/pull/8469
962
982
  [#8470]: https://github.com/activeadmin/activeadmin/pull/8470
983
+ [#8548]: https://github.com/activeadmin/activeadmin/pull/8548
984
+ [#8551]: https://github.com/activeadmin/activeadmin/pull/8551
985
+ [#8556]: https://github.com/activeadmin/activeadmin/pull/8556
986
+ [#8596]: https://github.com/activeadmin/activeadmin/pull/8596
987
+ [#8601]: https://github.com/activeadmin/activeadmin/pull/8601
988
+ [#8614]: https://github.com/activeadmin/activeadmin/pull/8614
989
+ [#8650]: https://github.com/activeadmin/activeadmin/pull/8650
990
+ [#8652]: https://github.com/activeadmin/activeadmin/pull/8652
991
+ [#8837]: https://github.com/activeadmin/activeadmin/pull/8837
963
992
 
964
993
  [@1000ship]: https://github.com/1000ship
965
994
  [@5t111111]: https://github.com/5t111111
@@ -1040,6 +1069,7 @@ Please check [0-6-stable] for previous changes.
1040
1069
  [@Looooong]: https://github.com/Looooong
1041
1070
  [@lubosch]: https://github.com/lubosch
1042
1071
  [@markstory]: https://github.com/markstory
1072
+ [@mattbrictson]: https://github.com/mattbrictson
1043
1073
  [@mauriciopasquier]: https://github.com/mauriciopasquier
1044
1074
  [@mconiglio]: https://github.com/mconiglio
1045
1075
  [@mgrunberg]: https://github.com/mgrunberg
@@ -468,23 +468,19 @@
468
468
  $.fn["perPage"] = PerPage._jQueryInterface;
469
469
  $.fn["perPage"].Constructor = PerPage;
470
470
  })(jQuery);
471
- function _inheritsLoose(subClass, superClass) {
472
- subClass.prototype = Object.create(superClass.prototype);
473
- subClass.prototype.constructor = subClass;
474
- _setPrototypeOf(subClass, superClass);
471
+ function _inheritsLoose(t, o) {
472
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
475
473
  }
476
- function _setPrototypeOf(o, p) {
477
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
478
- o.__proto__ = p;
479
- return o;
480
- };
481
- return _setPrototypeOf(o, p);
474
+ function _setPrototypeOf(t, e) {
475
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
476
+ return t.__proto__ = e, t;
477
+ }, _setPrototypeOf(t, e);
482
478
  }
483
479
  var TableCheckboxToggler = function(_CheckboxToggler) {
484
- _inheritsLoose(TableCheckboxToggler, _CheckboxToggler);
485
480
  function TableCheckboxToggler() {
486
481
  return _CheckboxToggler.apply(this, arguments) || this;
487
482
  }
483
+ _inheritsLoose(TableCheckboxToggler, _CheckboxToggler);
488
484
  var _proto = TableCheckboxToggler.prototype;
489
485
  _proto._bind = function _bind() {
490
486
  var _this = this;
@@ -95,7 +95,7 @@ module ActiveAdmin
95
95
  contents = without_wrapper { inputs(options, &form_block) }
96
96
  contents ||= "".html_safe
97
97
 
98
- js = new_record ? js_for_has_many(options[:class], &form_block) : ""
98
+ js = new_record ? js_for_has_many(&form_block) : ""
99
99
  contents << js
100
100
  end
101
101
 
@@ -159,14 +159,13 @@ module ActiveAdmin
159
159
  end
160
160
 
161
161
  # Capture the ADD JS
162
- def js_for_has_many(class_string, &form_block)
162
+ def js_for_has_many(&form_block)
163
163
  assoc_name = assoc_klass.model_name
164
- placeholder = "NEW_#{assoc_name.to_s.underscore.upcase.gsub(/\//, '_')}_RECORD"
165
- opts = {
164
+ placeholder = "NEW_#{assoc_name.to_s.underscore.upcase.tr('/', '_')}_RECORD"
165
+ opts = options.merge(
166
166
  for: [assoc, assoc_klass.new],
167
- class: class_string,
168
167
  for_options: { child_index: placeholder }
169
- }
168
+ )
170
169
  html = template.capture { __getobj__.send(:inputs_for_nested_attributes, opts, &form_block) }
171
170
  text = new_record.is_a?(String) ? new_record : I18n.t("active_admin.has_many_new", model: assoc_name.human)
172
171
 
@@ -15,9 +15,7 @@ module ActiveAdmin
15
15
  if searchable_has_many_through?
16
16
  "#{reflection.through_reflection.name}_#{reflection.foreign_key}"
17
17
  else
18
- name = method.to_s
19
- name.concat "_#{reflection.association_primary_key}" if reflection_searchable?
20
- name
18
+ reflection_searchable? ? "#{method}_#{reflection.association_primary_key}" : method.to_s
21
19
  end
22
20
  end
23
21
 
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require "active_admin/resource"
3
2
 
4
3
  module ActiveAdmin
5
4
  class Resource
@@ -21,7 +21,7 @@ module ActiveAdmin
21
21
  if namespace.root?
22
22
  router.root namespace.root_to_options.merge(to: namespace.root_to)
23
23
  else
24
- router.namespace namespace.name, namespace.route_options.dup do
24
+ router.namespace namespace.name, **namespace.route_options.dup do
25
25
  router.root namespace.root_to_options.merge(to: namespace.root_to, as: :root)
26
26
  end
27
27
  end
@@ -65,7 +65,7 @@ module ActiveAdmin
65
65
 
66
66
  def page_routes(config)
67
67
  page = config.underscored_resource_name
68
- router.get "/#{page}" => "#{page}#index"
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
71
  build_route(verb, "/#{page}/#{action.name}" => "#{page}##{action.name}")
@@ -91,8 +91,8 @@ module ActiveAdmin
91
91
  build_route(action.http_verb, action.name)
92
92
  end
93
93
 
94
- def build_route(verbs, *args)
95
- Array.wrap(verbs).each { |verb| router.send(verb, *args) }
94
+ def build_route(verbs, ...)
95
+ Array.wrap(verbs).each { |verb| router.send(verb, ...) }
96
96
  end
97
97
 
98
98
  def define_belongs_to_routes(config)
@@ -107,7 +107,7 @@ module ActiveAdmin
107
107
  end
108
108
 
109
109
  def define_namespace(config)
110
- router.namespace config.namespace.name, config.namespace.route_options.dup do
110
+ router.namespace config.namespace.name, **config.namespace.route_options.dup do
111
111
  define_routes(config)
112
112
  end
113
113
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "3.2.5"
3
+ VERSION = "3.4.0"
4
4
  end
@@ -291,9 +291,14 @@ module ActiveAdmin
291
291
  end
292
292
 
293
293
  # Display a column for the id
294
- def id_column
294
+ def id_column(*args)
295
295
  raise "#{resource_class.name} has no primary_key!" unless resource_class.primary_key
296
- column(resource_class.human_attribute_name(resource_class.primary_key), sortable: resource_class.primary_key) do |resource|
296
+
297
+ options = args.extract_options!
298
+ title = args[0].presence || resource_class.human_attribute_name(resource_class.primary_key)
299
+ sortable = options.fetch(:sortable, resource_class.primary_key)
300
+
301
+ column(title, sortable: sortable) do |resource|
297
302
  if controller.action_methods.include?("show")
298
303
  link_to resource.id, resource_path(resource), class: "resource_id_link"
299
304
  elsif controller.action_methods.include?("edit")
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.2.5
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh
@@ -12,10 +12,9 @@ authors:
12
12
  - Piers C
13
13
  - Sean Linsley
14
14
  - Timo Schilling
15
- autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
- date: 2024-09-05 00:00:00.000000000 Z
17
+ date: 1980-01-02 00:00:00.000000000 Z
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
21
20
  name: arbre
@@ -518,7 +517,6 @@ metadata:
518
517
  rubygems_mfa_required: 'true'
519
518
  source_code_uri: https://github.com/activeadmin/activeadmin
520
519
  wiki_uri: https://github.com/activeadmin/activeadmin/wiki
521
- post_install_message:
522
520
  rdoc_options: []
523
521
  require_paths:
524
522
  - lib
@@ -533,8 +531,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
533
531
  - !ruby/object:Gem::Version
534
532
  version: '0'
535
533
  requirements: []
536
- rubygems_version: 3.5.16
537
- signing_key:
534
+ rubygems_version: 3.6.9
538
535
  specification_version: 4
539
536
  summary: Active Admin is a Ruby on Rails plugin for generating administration style
540
537
  interfaces. It abstracts common business application patterns to make it simple