activeadmin 2.12.0 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/CONTRIBUTING.md +1 -1
- data/docs/5-forms.md +2 -1
- data/docs/Gemfile.lock +1 -1
- data/lib/active_admin/application.rb +4 -4
- data/lib/active_admin/namespace.rb +2 -2
- data/lib/active_admin/pundit_adapter.rb +18 -10
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b3beb756b607b196f72d4ec4a4b173867021bb2eba03d183797165810a526b5
|
4
|
+
data.tar.gz: bed4421fc6a28f2ff0bee9659a76bfd680b9432c74d290753c62392c3a7048d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11cce1d23fb4519f394ef13930716fabe39e6d7654f5c4424c887fe54e6d56225700155ae59187ad42a6551d9bcf17f95652c08d234ddafb5ba2d4fb5e444a09
|
7
|
+
data.tar.gz: 452592e57f8fe9f16e683a2f54b9dc7fdd717d1ec2db909710a07cfb74dda5d8f7a0efda515b439555470381da020e75b2d4dfe328a8b52bc436b2f94371525b
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,27 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.13.1 [☰](https://github.com/activeadmin/activeadmin/compare/v2.13.0..v2.13.1)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* Honor load paths order when loading admin files. [#7488] by [@tf]
|
10
|
+
* Fix passing expected hash payload argument. [#7487] by [@ispyropoulos]
|
11
|
+
|
12
|
+
## 2.13.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.12.0..v2.13.0)
|
13
|
+
|
14
|
+
### Documentation
|
15
|
+
|
16
|
+
* Update validation errors documentation to account for deprecated `ActiveModel::Errors#keys`. [#7475] by [@amit]
|
17
|
+
|
18
|
+
### Dependency Changes
|
19
|
+
|
20
|
+
* Drop rails 6.0 support. [#7476] by [@deivid-rodriguez]
|
21
|
+
|
22
|
+
### Performance
|
23
|
+
|
24
|
+
* Fix pundit performance. [#7479] by [@deivid-rodriguez]
|
25
|
+
|
5
26
|
## 2.12.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.11.2..v2.12.0)
|
6
27
|
|
7
28
|
### Enhancements
|
@@ -772,6 +793,11 @@ Please check [0-6-stable] for previous changes.
|
|
772
793
|
[#7384]: https://github.com/activeadmin/activeadmin/pull/7384
|
773
794
|
[#7394]: https://github.com/activeadmin/activeadmin/pull/7394
|
774
795
|
[#7453]: https://github.com/activeadmin/activeadmin/pull/7453
|
796
|
+
[#7475]: https://github.com/activeadmin/activeadmin/pull/7475
|
797
|
+
[#7476]: https://github.com/activeadmin/activeadmin/pull/7476
|
798
|
+
[#7479]: https://github.com/activeadmin/activeadmin/pull/7479
|
799
|
+
[#7487]: https://github.com/activeadmin/activeadmin/pull/7487
|
800
|
+
[#7488]: https://github.com/activeadmin/activeadmin/pull/7488
|
775
801
|
|
776
802
|
[@1000ship]: https://github.com/1000ship
|
777
803
|
[@5t111111]: https://github.com/5t111111
|
@@ -782,6 +808,7 @@ Please check [0-6-stable] for previous changes.
|
|
782
808
|
[@alejandroperea]: https://github.com/alejandroperea
|
783
809
|
[@alex-bogomolov]: https://github.com/alex-bogomolov
|
784
810
|
[@amiel]: https://github.com/amiel
|
811
|
+
[@amit]: https://github.com/amit
|
785
812
|
[@amiuhle]: https://github.com/amiuhle
|
786
813
|
[@andreslemik]: https://github.com/andreslemik
|
787
814
|
[@bartoszkopinski]: https://github.com/bartoszkopinski
|
@@ -818,6 +845,7 @@ Please check [0-6-stable] for previous changes.
|
|
818
845
|
[@innparusu95]: https://github.com/innparusu95
|
819
846
|
[@ionut998]: https://github.com/ionut998
|
820
847
|
[@irmela]: https://github.com/irmela
|
848
|
+
[@ispyropoulos]: https://github.com/ispyropoulos
|
821
849
|
[@Ivanov-Anton]: https://github.com/Ivanov-Anton
|
822
850
|
[@jasl]: https://github.com/jasl
|
823
851
|
[@javawizard]: https://github.com/javawizard
|
@@ -876,6 +904,7 @@ Please check [0-6-stable] for previous changes.
|
|
876
904
|
[@stereoscott]: https://github.com/stereoscott
|
877
905
|
[@tagliala]: https://github.com/tagliala
|
878
906
|
[@taralbass]: https://github.com/taralbass
|
907
|
+
[@tf]: https://github.com/tf
|
879
908
|
[@tiagotex]: https://github.com/tiagotex
|
880
909
|
[@timoschilling]: https://github.com/timoschilling
|
881
910
|
[@TimPetricola]: https://github.com/TimPetricola
|
data/CONTRIBUTING.md
CHANGED
@@ -63,7 +63,7 @@ If you want to test against a Rails version different from the latest, make sure
|
|
63
63
|
you use the correct Gemfile, for example:
|
64
64
|
|
65
65
|
```sh
|
66
|
-
export BUNDLE_GEMFILE=gemfiles/
|
66
|
+
export BUNDLE_GEMFILE=gemfiles/rails_61/Gemfile
|
67
67
|
```
|
68
68
|
|
69
69
|
**Warning** SCSS assets are aimed to be used indifferently with Sprockets **and** webpacker.
|
data/docs/5-forms.md
CHANGED
data/docs/Gemfile.lock
CHANGED
@@ -76,7 +76,7 @@ module ActiveAdmin
|
|
76
76
|
|
77
77
|
namespace = namespaces[name.to_sym] ||= begin
|
78
78
|
namespace = Namespace.new(self, name)
|
79
|
-
ActiveSupport::Notifications.instrument ActiveAdmin::Namespace::RegisterEvent, namespace
|
79
|
+
ActiveSupport::Notifications.instrument ActiveAdmin::Namespace::RegisterEvent, { active_admin_namespace: namespace }
|
80
80
|
namespace
|
81
81
|
end
|
82
82
|
|
@@ -112,10 +112,10 @@ module ActiveAdmin
|
|
112
112
|
# To reload everything simply call `ActiveAdmin.unload!`
|
113
113
|
def load!
|
114
114
|
unless loaded?
|
115
|
-
ActiveSupport::Notifications.instrument BeforeLoadEvent, self # before_load hook
|
115
|
+
ActiveSupport::Notifications.instrument BeforeLoadEvent, { active_admin_application: self } # before_load hook
|
116
116
|
files.each { |file| load file } # load files
|
117
117
|
namespace(default_namespace) # init AA resources
|
118
|
-
ActiveSupport::Notifications.instrument AfterLoadEvent, self # after_load hook
|
118
|
+
ActiveSupport::Notifications.instrument AfterLoadEvent, { active_admin_application: self } # after_load hook
|
119
119
|
@@loaded = true
|
120
120
|
end
|
121
121
|
end
|
@@ -126,7 +126,7 @@ module ActiveAdmin
|
|
126
126
|
|
127
127
|
# Returns ALL the files to be loaded
|
128
128
|
def files
|
129
|
-
load_paths.flatten.compact.uniq.flat_map { |path| Dir["#{path}/**/*.rb"] }
|
129
|
+
load_paths.flatten.compact.uniq.flat_map { |path| Dir["#{path}/**/*.rb"].sort }
|
130
130
|
end
|
131
131
|
|
132
132
|
# Creates all the necessary routes for the ActiveAdmin configurations
|
@@ -60,7 +60,7 @@ module ActiveAdmin
|
|
60
60
|
settings.respond_to?(method) ? settings.send(method, *args) : super
|
61
61
|
end
|
62
62
|
|
63
|
-
# Register a resource into this namespace. The
|
63
|
+
# Register a resource into this namespace. The preferred method to access this is to
|
64
64
|
# use the global registration ActiveAdmin.register which delegates to the proper
|
65
65
|
# namespace instance.
|
66
66
|
def register(resource_class, options = {}, &block)
|
@@ -72,7 +72,7 @@ module ActiveAdmin
|
|
72
72
|
reset_menu!
|
73
73
|
|
74
74
|
# Dispatch a registration event
|
75
|
-
ActiveSupport::Notifications.instrument ActiveAdmin::Resource::RegisterEvent, config
|
75
|
+
ActiveSupport::Notifications.instrument ActiveAdmin::Resource::RegisterEvent, { active_admin_resource: config }
|
76
76
|
|
77
77
|
# Return the config
|
78
78
|
config
|
@@ -31,14 +31,13 @@ module ActiveAdmin
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def retrieve_policy(subject)
|
34
|
-
|
35
|
-
|
36
|
-
if (policy = compat_policy(subject))
|
34
|
+
target = policy_target(subject)
|
35
|
+
if (policy = policy(namespace(target)) || compat_policy(subject))
|
37
36
|
policy
|
38
37
|
elsif default_policy_class
|
39
|
-
default_policy(
|
38
|
+
default_policy(subject)
|
40
39
|
else
|
41
|
-
raise
|
40
|
+
raise Pundit::NotDefinedError, "unable to find a compatible policy for `#{target}`"
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
@@ -71,11 +70,12 @@ module ActiveAdmin
|
|
71
70
|
# This fallback might be removed in future versions of ActiveAdmin, so
|
72
71
|
# pundit_adapter search will work consistently with provided namespaces
|
73
72
|
def compat_policy(subject)
|
73
|
+
return unless default_policy_namespace
|
74
|
+
|
74
75
|
target = policy_target(subject)
|
75
76
|
|
76
|
-
return unless
|
77
|
-
target
|
78
|
-
(policy = Pundit.policy(user, target))
|
77
|
+
return unless target.class.to_s.include?(default_policy_module) &&
|
78
|
+
(policy = policy(target))
|
79
79
|
|
80
80
|
policy_name = policy.class.to_s
|
81
81
|
|
@@ -89,7 +89,7 @@ module ActiveAdmin
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def namespace(object)
|
92
|
-
if default_policy_namespace && !object.class.to_s.
|
92
|
+
if default_policy_namespace && !object.class.to_s.start_with?("#{default_policy_module}::")
|
93
93
|
[default_policy_namespace.to_sym, object]
|
94
94
|
else
|
95
95
|
object
|
@@ -100,7 +100,7 @@ module ActiveAdmin
|
|
100
100
|
ActiveAdmin.application.pundit_default_policy && ActiveAdmin.application.pundit_default_policy.constantize
|
101
101
|
end
|
102
102
|
|
103
|
-
def default_policy(
|
103
|
+
def default_policy(subject)
|
104
104
|
default_policy_class.new(user, subject)
|
105
105
|
end
|
106
106
|
|
@@ -112,6 +112,14 @@ module ActiveAdmin
|
|
112
112
|
default_policy_namespace.to_s.camelize
|
113
113
|
end
|
114
114
|
|
115
|
+
def policy(target)
|
116
|
+
policies[target] ||= Pundit.policy(user, target)
|
117
|
+
end
|
118
|
+
|
119
|
+
def policies
|
120
|
+
@policies ||= {}
|
121
|
+
end
|
122
|
+
|
115
123
|
end
|
116
124
|
|
117
125
|
end
|
data/lib/active_admin/version.rb
CHANGED
data/lib/active_admin.rb
CHANGED
@@ -113,7 +113,7 @@ module ActiveAdmin
|
|
113
113
|
private
|
114
114
|
|
115
115
|
def wrap_block_for_active_support_notifications block
|
116
|
-
proc { |_name, _start, _finish, _id, payload| block.call payload }
|
116
|
+
proc { |_name, _start, _finish, _id, payload| block.call payload[:active_admin_application] }
|
117
117
|
end
|
118
118
|
|
119
119
|
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: 2.
|
4
|
+
version: 2.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Maresh
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2022-
|
18
|
+
date: 2022-05-20 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: arbre
|
@@ -125,7 +125,7 @@ dependencies:
|
|
125
125
|
requirements:
|
126
126
|
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version: '6.
|
128
|
+
version: '6.1'
|
129
129
|
- - "<"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '7.1'
|
@@ -135,7 +135,7 @@ dependencies:
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '6.
|
138
|
+
version: '6.1'
|
139
139
|
- - "<"
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '7.1'
|
@@ -578,7 +578,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
578
578
|
- !ruby/object:Gem::Version
|
579
579
|
version: '0'
|
580
580
|
requirements: []
|
581
|
-
rubygems_version: 3.3.
|
581
|
+
rubygems_version: 3.3.7
|
582
582
|
signing_key:
|
583
583
|
specification_version: 4
|
584
584
|
summary: Active Admin is a Ruby on Rails plugin for generating administration style
|