bp3-activeadmin 0.2.0 → 0.2.1

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: 635a4a2c2a9466d8e3669f7b4f388564db6b786571a6d84da3ba9de860f6ca78
4
- data.tar.gz: 37f8d4b7a21ff7e817b74dc18f217c5330de5adf3c8b35deba7b751828f3d840
3
+ metadata.gz: 65ba710517022adea3ee5fcda381918ea3bdf46f7b888682b1f3b13ce6d0ef0f
4
+ data.tar.gz: 21034d1c5ef08a4cf3fe531148c8563fa402cdb3d8126a8cf35142951c307503
5
5
  SHA512:
6
- metadata.gz: 55fb2da785ddf845ecd3b8e4d29d736d9432b4654de299fa52642d478c920cfb16b921572acbc46a04171b3608f1975be579f332271d961a519d0994b982a2b2
7
- data.tar.gz: 425583b554d9cc34728fa37ff7591cb58cb2070962aefc44848a21673488500d975b69f4d2edb8f83a0278ad7b4e403d17ffcea733b330d11c1e53921a78d9f8
6
+ metadata.gz: c74c7384d5e8c33ee9a24bee1c201c66c3f4dda905a720228da4a6469266dfc9c4e7b3c872f1859a26ed9bb9b5c1247c467200e929b0b27fbb9072d0dee2b977
7
+ data.tar.gz: 976e099a624f2e5b0697227246bd7b52aa9987146fa3cd2a635b00af129c43e0584e9baa8673ec6ad75e8e767a043ba55b9a049794f7f30f461b362c8869ec91
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2026-10-30
4
+
5
+ ### Security
6
+
7
+ - Answer `EXPLORE` through `Bp3::Core::Ransackable` on `ActiveAdmin::Comment`, whose own class methods
8
+ otherwise allowed every column and association to it
9
+ - Require bp3-core 0.4.0, for `Bp3::Core::Ransackable::EXPLORE`
10
+
3
11
  ## [0.2.0] - 2026-01-12
4
12
 
5
13
  - Update activeadmin gem dependency to 4.0.0.beta16
data/CLAUDE.md ADDED
@@ -0,0 +1,52 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ bp3-activeadmin adapts `activeadmin` (4.x) for BP3 (persuavis/black_phoebe_3), a multi-site multi-tenant
8
+ Rails application. It keeps ActiveAdmin's default filters inside what each model allows ransack to search.
9
+
10
+ ## Commands
11
+
12
+ The gems run on Ruby 3.4.6 (`.ruby-version`). Prefix commands with `~/.rvm/bin/rvm 3.4.6 do` when the
13
+ shell is not already on it; a missing `rspec` means the wrong Ruby, not a missing bundle.
14
+
15
+ - `bundle exec rake` - specs and RuboCop (the default task)
16
+ - `bundle exec rspec spec/path/to/file_spec.rb[:LINE]` - one file or example
17
+ - `bundle exec rubocop` / `bundle exec rubocop -a`
18
+ - `bin/setup`, `bin/console`, `rake install`
19
+
20
+ ## Architecture
21
+
22
+ `lib/bp3/activeadmin/railtie.rb` runs in an `after_initialize` block:
23
+
24
+ - prepends `PrependResourceExtension` to `ActiveAdmin::Filters::ResourceExtension`, so `default_filters`
25
+ keeps only the fields in `resource_class.ransackable_fields(auth_object)` (from `Bp3::Core::Ransackable`)
26
+ - `auth_object` is the configured request state class sent the configured method
27
+ - includes `Bp3::Core::Ransackable` in `ActiveAdmin::Comment`
28
+
29
+ **Configuration** (`lib/bp3/activeadmin.rb`): `Bp3::Activeadmin.global_request_state_class_name` and
30
+ `.global_request_state_method`. The application's `config/initializers/bp3-activeadmin.rb` sets them to
31
+ `'GlobalRequestState'` and `:current_login` (the README's example still shows `:highest_privilege`).
32
+
33
+ The entry file is `lib/bp3-active_admin.rb`, not `lib/bp3-activeadmin.rb`; Bundler's autorequire finds
34
+ `bp3/activeadmin` instead.
35
+
36
+ ## Testing
37
+
38
+ The spec only checks the version; the Railtie needs a Rails application with ActiveAdmin to exercise. Try a
39
+ change against the application (black_phoebe_3) by putting this repo's `lib` ahead of the bundled gem.
40
+
41
+ ## Code Style
42
+
43
+ - RuboCop (`.rubocop.yml`): target Ruby 3.2.2, NewCops, rubocop-rake and rubocop-rspec; AbcSize 26,
44
+ MethodLength 15, BlockLength 66, ModuleLength 150; `Lint/ConstantDefinitionInBlock` and `Lint/Void`
45
+ are off for `lib/bp3/**/railtie.rb`, where classes are reopened inside a block
46
+ - Every file starts with `# frozen_string_literal: true`
47
+ - American English; no trailing whitespace on any added or modified line
48
+
49
+ ## Release
50
+
51
+ Bump `lib/bp3/activeadmin/version.rb` and add a `CHANGELOG.md` entry. `rake release` tags, pushes and
52
+ publishes to rubygems.org; leave releasing and committing to the user.
data/Gemfile.lock CHANGED
@@ -1,18 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bp3-activeadmin (0.2.0)
4
+ bp3-activeadmin (0.2.1)
5
5
  activeadmin (>= 4.0.0.beta16)
6
6
  activesupport (~> 8.1)
7
- bp3-core (>= 0.1.0)
7
+ bp3-core (>= 0.4.0)
8
8
  bp3-request_state (>= 0.1.0)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (8.1.2)
14
- actionview (= 8.1.2)
15
- activesupport (= 8.1.2)
13
+ actionpack (8.1.4)
14
+ actionview (= 8.1.4)
15
+ activesupport (= 8.1.4)
16
16
  nokogiri (>= 1.8.5)
17
17
  rack (>= 2.2.4)
18
18
  rack-session (>= 1.0.1)
@@ -20,28 +20,28 @@ GEM
20
20
  rails-dom-testing (~> 2.2)
21
21
  rails-html-sanitizer (~> 1.6)
22
22
  useragent (~> 0.16)
23
- actionview (8.1.2)
24
- activesupport (= 8.1.2)
23
+ actionview (8.1.4)
24
+ activesupport (= 8.1.4)
25
25
  builder (~> 3.1)
26
26
  erubi (~> 1.11)
27
27
  rails-dom-testing (~> 2.2)
28
28
  rails-html-sanitizer (~> 1.6)
29
- activeadmin (4.0.0.beta19)
29
+ activeadmin (4.0.0.beta23)
30
30
  arbre (~> 2.0)
31
31
  csv
32
- formtastic (>= 5.0)
32
+ formtastic (>= 6.0)
33
33
  formtastic_i18n (>= 0.7)
34
34
  inherited_resources (~> 2.0)
35
35
  kaminari (>= 1.2.1)
36
- railties (>= 7.0)
36
+ railties (>= 7.2)
37
37
  ransack (>= 4.0)
38
- activemodel (8.1.2)
39
- activesupport (= 8.1.2)
40
- activerecord (8.1.2)
41
- activemodel (= 8.1.2)
42
- activesupport (= 8.1.2)
38
+ activemodel (8.1.4)
39
+ activesupport (= 8.1.4)
40
+ activerecord (8.1.4)
41
+ activemodel (= 8.1.4)
42
+ activesupport (= 8.1.4)
43
43
  timeout (>= 0.4.0)
44
- activesupport (8.1.2)
44
+ activesupport (8.1.4)
45
45
  base64
46
46
  bigdecimal
47
47
  concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -58,8 +58,8 @@ GEM
58
58
  activesupport (>= 7.0)
59
59
  ast (2.4.3)
60
60
  base64 (0.3.0)
61
- bigdecimal (4.0.1)
62
- bp3-core (0.2.0)
61
+ bigdecimal (4.1.3)
62
+ bp3-core (0.4.0)
63
63
  actionview (~> 8.1)
64
64
  activesupport (~> 8.1)
65
65
  bp3-request_state (~> 0.1)
@@ -68,73 +68,71 @@ GEM
68
68
  activesupport (~> 8.1)
69
69
  request_store (>= 1.5.1)
70
70
  builder (3.3.0)
71
- concurrent-ruby (1.3.6)
71
+ concurrent-ruby (1.3.8)
72
72
  connection_pool (3.0.2)
73
- crass (1.0.6)
74
- csv (3.3.5)
75
- date (3.5.1)
73
+ crass (1.0.8)
74
+ csv (3.3.7)
76
75
  diff-lcs (1.6.2)
77
76
  drb (2.2.3)
78
- erb (6.0.1)
77
+ erb (6.0.7)
79
78
  erubi (1.13.1)
80
- formtastic (5.0.0)
81
- actionpack (>= 6.0.0)
79
+ formtastic (6.0.0)
80
+ actionpack (>= 7.2.0)
82
81
  formtastic_i18n (0.7.0)
83
82
  has_scope (0.9.0)
84
83
  actionpack (>= 7.0)
85
84
  activesupport (>= 7.0)
86
- i18n (1.14.8)
85
+ i18n (1.15.2)
87
86
  concurrent-ruby (~> 1.0)
88
87
  inherited_resources (2.1.0)
89
88
  actionpack (>= 7.0)
90
89
  has_scope (>= 0.6)
91
90
  railties (>= 7.0)
92
91
  responders (>= 2)
93
- io-console (0.8.2)
94
- irb (1.16.0)
92
+ io-console (0.9.5)
93
+ irb (1.18.0)
95
94
  pp (>= 0.6.0)
95
+ prism (>= 1.3.0)
96
96
  rdoc (>= 4.0.0)
97
97
  reline (>= 0.4.2)
98
- json (2.18.0)
99
- kaminari (1.2.2)
98
+ json (3.1.0)
99
+ kaminari (1.3.2)
100
100
  activesupport (>= 4.1.0)
101
- kaminari-actionview (= 1.2.2)
102
- kaminari-activerecord (= 1.2.2)
103
- kaminari-core (= 1.2.2)
104
- kaminari-actionview (1.2.2)
101
+ kaminari-actionview (= 1.3.2)
102
+ kaminari-activerecord (= 1.3.2)
103
+ kaminari-core (= 1.3.2)
104
+ kaminari-actionview (1.3.2)
105
105
  actionview
106
- kaminari-core (= 1.2.2)
107
- kaminari-activerecord (1.2.2)
106
+ kaminari-core (= 1.3.2)
107
+ kaminari-activerecord (1.3.2)
108
108
  activerecord
109
- kaminari-core (= 1.2.2)
110
- kaminari-core (1.2.2)
111
- language_server-protocol (3.17.0.5)
109
+ kaminari-core (= 1.3.2)
110
+ kaminari-core (1.3.2)
111
+ language_server-protocol (3.17.0.6)
112
112
  lint_roller (1.1.0)
113
113
  logger (1.7.0)
114
- loofah (2.25.0)
114
+ loofah (2.25.2)
115
115
  crass (~> 1.0.2)
116
116
  nokogiri (>= 1.12.0)
117
- minitest (6.0.1)
117
+ minitest (6.0.6)
118
+ drb (~> 2.0)
118
119
  prism (~> 1.5)
119
- nokogiri (1.19.0-x86_64-darwin)
120
+ nokogiri (1.19.4-x86_64-darwin)
120
121
  racc (~> 1.4)
121
- parallel (1.27.0)
122
- parser (3.3.10.0)
122
+ parallel (2.3.0)
123
+ parser (3.3.13.0)
123
124
  ast (~> 2.4.1)
124
125
  racc
125
- pp (0.6.3)
126
+ pp (0.6.4)
126
127
  prettyprint
127
- prettyprint (0.2.0)
128
- prism (1.7.0)
129
- psych (5.3.1)
130
- date
131
- stringio
128
+ prettyprint (0.2.1)
129
+ prism (1.9.0)
132
130
  racc (1.8.1)
133
- rack (3.2.4)
134
- rack-session (2.1.1)
131
+ rack (3.2.8)
132
+ rack-session (2.1.2)
135
133
  base64 (>= 0.1.0)
136
134
  rack (>= 3.0.0)
137
- rack-test (2.2.0)
135
+ rack-test (2.3.0)
138
136
  rack (>= 1.3)
139
137
  rackup (2.3.1)
140
138
  rack (>= 3)
@@ -142,12 +140,12 @@ GEM
142
140
  activesupport (>= 5.0.0)
143
141
  minitest
144
142
  nokogiri (>= 1.6)
145
- rails-html-sanitizer (1.6.2)
146
- loofah (~> 2.21)
143
+ rails-html-sanitizer (1.7.1)
144
+ loofah (~> 2.25, >= 2.25.2)
147
145
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
148
- railties (8.1.2)
149
- actionpack (= 8.1.2)
150
- activesupport (= 8.1.2)
146
+ railties (8.1.4)
147
+ actionpack (= 8.1.4)
148
+ activesupport (= 8.1.4)
151
149
  irb (~> 1.13)
152
150
  rackup (>= 1.0.0)
153
151
  rake (>= 12.2)
@@ -155,21 +153,26 @@ GEM
155
153
  tsort (>= 0.2)
156
154
  zeitwerk (~> 2.6)
157
155
  rainbow (3.1.1)
158
- rake (13.3.1)
159
- ransack (4.4.1)
156
+ rake (13.4.2)
157
+ ransack (6.0.1)
160
158
  activerecord (>= 7.2)
161
159
  activesupport (>= 7.2)
162
160
  i18n
163
- rdoc (7.0.3)
161
+ rbs (4.2.0)
162
+ logger
163
+ prism (>= 1.6.0)
164
+ tsort
165
+ rdoc (8.1.0)
164
166
  erb
165
- psych (>= 4.0.0)
167
+ prism (>= 1.6.0)
168
+ rbs (>= 4.0.0)
166
169
  tsort
167
- regexp_parser (2.11.3)
168
- reline (0.6.3)
170
+ regexp_parser (2.13.1)
171
+ reline (0.7.0)
169
172
  io-console (~> 0.5)
170
173
  request_store (1.7.0)
171
174
  rack (>= 1.4)
172
- responders (3.2.0)
175
+ responders (3.2.1)
173
176
  actionpack (>= 7.0)
174
177
  railties (>= 7.0)
175
178
  rspec (3.13.2)
@@ -181,44 +184,44 @@ GEM
181
184
  rspec-expectations (3.13.5)
182
185
  diff-lcs (>= 1.2.0, < 2.0)
183
186
  rspec-support (~> 3.13.0)
184
- rspec-mocks (3.13.7)
187
+ rspec-mocks (3.13.8)
185
188
  diff-lcs (>= 1.2.0, < 2.0)
186
189
  rspec-support (~> 3.13.0)
187
- rspec-support (3.13.6)
188
- rubocop (1.82.1)
189
- json (~> 2.3)
190
+ rspec-support (3.13.7)
191
+ rubocop (1.92.2)
192
+ json (>= 2.3)
190
193
  language_server-protocol (~> 3.17.0.2)
191
194
  lint_roller (~> 1.1.0)
192
- parallel (~> 1.10)
195
+ parallel (>= 1.10)
193
196
  parser (>= 3.3.0.2)
194
197
  rainbow (>= 2.2.2, < 4.0)
195
- regexp_parser (>= 2.9.3, < 3.0)
196
- rubocop-ast (>= 1.48.0, < 2.0)
198
+ regexp_parser (>= 2.11.3, < 3.0)
199
+ rubocop-ast (>= 1.49.0, < 2.0)
197
200
  ruby-progressbar (~> 1.7)
198
201
  unicode-display_width (>= 2.4.0, < 4.0)
199
- rubocop-ast (1.49.0)
202
+ rubocop-ast (1.50.0)
200
203
  parser (>= 3.3.7.2)
201
204
  prism (~> 1.7)
202
205
  rubocop-rake (0.7.1)
203
206
  lint_roller (~> 1.1)
204
207
  rubocop (>= 1.72.1)
205
- rubocop-rspec (3.9.0)
208
+ rubocop-rspec (3.10.2)
206
209
  lint_roller (~> 1.1)
207
- rubocop (~> 1.81)
210
+ regexp_parser (>= 2.0)
211
+ rubocop (~> 1.86, >= 1.86.2)
208
212
  ruby-progressbar (1.13.0)
209
213
  securerandom (0.4.1)
210
- stringio (3.2.0)
211
214
  thor (1.5.0)
212
- timeout (0.6.0)
215
+ timeout (0.6.1)
213
216
  tsort (0.2.0)
214
217
  tzinfo (2.0.6)
215
218
  concurrent-ruby (~> 1.0)
216
- unicode-display_width (3.2.0)
217
- unicode-emoji (~> 4.1)
218
- unicode-emoji (4.2.0)
219
- uri (1.1.1)
219
+ unicode-display_width (3.3.0)
220
+ unicode-emoji (~> 4.3)
221
+ unicode-emoji (4.3.0)
222
+ uri (1.1.2)
220
223
  useragent (0.16.11)
221
- zeitwerk (2.7.4)
224
+ zeitwerk (2.8.3)
222
225
 
223
226
  PLATFORMS
224
227
  x86_64-darwin-22
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_dependency 'activeadmin', '>= 4.0.0.beta16'
35
35
  spec.add_dependency 'activesupport', '~> 8.1'
36
- spec.add_dependency 'bp3-core', '>= 0.1.0'
36
+ spec.add_dependency 'bp3-core', '>= 0.4.0'
37
37
  spec.add_dependency 'bp3-request_state', '>= 0.1.0'
38
38
 
39
39
  # spec.add_development_dependency 'bp3-core' # TODO: make this work
@@ -32,6 +32,20 @@ module Bp3
32
32
 
33
33
  class Comment
34
34
  include Bp3::Core::Ransackable
35
+
36
+ # ActiveAdmin defines these on the class itself, which beats anything included, so its
37
+ # answers stand only for plain ransack and Ransackable still answers EXPLORE
38
+ def self.ransackable_attributes(auth_object = nil)
39
+ return super if auth_object == Bp3::Core::Ransackable::EXPLORE
40
+
41
+ authorizable_ransackable_attributes
42
+ end
43
+
44
+ def self.ransackable_associations(auth_object = nil)
45
+ return super if auth_object == Bp3::Core::Ransackable::EXPLORE
46
+
47
+ authorizable_ransackable_associations
48
+ end
35
49
  end
36
50
  end
37
51
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bp3
4
4
  module Activeadmin
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bp3-activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wim den Braven
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.1.0
46
+ version: 0.4.0
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 0.1.0
53
+ version: 0.4.0
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: bp3-request_state
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -145,6 +145,7 @@ files:
145
145
  - ".rubocop.yml"
146
146
  - ".yardopts"
147
147
  - CHANGELOG.md
148
+ - CLAUDE.md
148
149
  - Gemfile
149
150
  - Gemfile.lock
150
151
  - LICENSE.txt
@@ -179,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
180
  - !ruby/object:Gem::Version
180
181
  version: '0'
181
182
  requirements: []
182
- rubygems_version: 3.6.9
183
+ rubygems_version: 4.0.4
183
184
  specification_version: 4
184
185
  summary: bp3-activeadmin adapts activeadmin for BP3 (persuavis/black_phoebe_3).
185
186
  test_files: []