administrate-field-nested_has_many 1.3.0 → 2.1.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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/.ruby-version +1 -1
  4. data/Appraisals +6 -6
  5. data/CHANGELOG.md +31 -0
  6. data/CODE_OF_CONDUCT.md +6 -0
  7. data/CONTRIBUTING.md +38 -0
  8. data/LICENSE.md +21 -0
  9. data/README.md +40 -1
  10. data/SECURITY.md +16 -0
  11. data/administrate-field-nested_has_many.gemspec +2 -3
  12. data/app/assets/javascripts/administrate-field-nested_has_many/application.js +6 -0
  13. data/app/views/fields/nested_has_many/_show.html.erb +35 -6
  14. data/bin/build-changelog +24 -0
  15. data/bin/setup +13 -0
  16. data/config/locales/administrate-field-nested_has_many.de.yml +7 -0
  17. data/config/locales/administrate-field-nested_has_many.fr.yml +7 -0
  18. data/gemfiles/{administrate_0.13.gemfile → administrate_0.19.gemfile} +1 -1
  19. data/gemfiles/administrate_0.19.gemfile.lock +260 -0
  20. data/gemfiles/{administrate_0.10.gemfile → administrate_0.20.gemfile} +1 -1
  21. data/gemfiles/administrate_0.20.gemfile.lock +260 -0
  22. data/gemfiles/{administrate_master.gemfile → administrate_main.gemfile} +1 -1
  23. data/gemfiles/administrate_main.gemfile.lock +266 -0
  24. data/lib/administrate/field/nested_has_many.rb +35 -15
  25. data/spec/dummy/Rakefile +1 -1
  26. data/spec/dummy/app/dashboards/school_dashboard.rb +1 -1
  27. data/spec/dummy/bin/rails +2 -2
  28. data/spec/dummy/bin/rake +2 -2
  29. data/spec/dummy/bin/setup +6 -9
  30. data/spec/dummy/config/application.rb +12 -9
  31. data/spec/dummy/config/boot.rb +1 -1
  32. data/spec/dummy/config/environment.rb +1 -1
  33. data/spec/dummy/config/environments/development.rb +16 -4
  34. data/spec/dummy/config/environments/test.rb +19 -6
  35. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
  36. data/spec/dummy/config/initializers/content_security_policy.rb +3 -0
  37. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  38. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  39. data/spec/dummy/config/locales/en.yml +1 -1
  40. data/spec/dummy/config/puma.rb +13 -4
  41. data/spec/dummy/config.ru +2 -1
  42. data/spec/dummy/db/schema.rb +14 -11
  43. data/spec/features/has_many_spec.rb +10 -0
  44. metadata +23 -39
  45. data/app/views/fields/nested_has_many/_show_current.html.erb +0 -44
  46. data/app/views/fields/nested_has_many/_show_old.html.erb +0 -36
  47. data/gemfiles/administrate_0.10.gemfile.lock +0 -214
  48. data/gemfiles/administrate_0.13.gemfile.lock +0 -207
  49. data/gemfiles/administrate_master.gemfile.lock +0 -219
  50. data/spec/dummy/app/mailers/application_mailer.rb +0 -4
  51. data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
  52. data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
  53. data/spec/dummy/config/cable.yml +0 -10
  54. data/spec/dummy/config/storage.yml +0 -34
@@ -0,0 +1,260 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ administrate-field-nested_has_many (2.1.0)
5
+ administrate (>= 0.19, < 1)
6
+ cocoon (~> 1.2, >= 1.2.11)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (7.1.3)
12
+ actionview (= 7.1.3)
13
+ activesupport (= 7.1.3)
14
+ nokogiri (>= 1.8.5)
15
+ racc
16
+ rack (>= 2.2.4)
17
+ rack-session (>= 1.0.1)
18
+ rack-test (>= 0.6.3)
19
+ rails-dom-testing (~> 2.2)
20
+ rails-html-sanitizer (~> 1.6)
21
+ actionview (7.1.3)
22
+ activesupport (= 7.1.3)
23
+ builder (~> 3.1)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ activemodel (7.1.3)
28
+ activesupport (= 7.1.3)
29
+ activerecord (7.1.3)
30
+ activemodel (= 7.1.3)
31
+ activesupport (= 7.1.3)
32
+ timeout (>= 0.4.0)
33
+ activesupport (7.1.3)
34
+ base64
35
+ bigdecimal
36
+ concurrent-ruby (~> 1.0, >= 1.0.2)
37
+ connection_pool (>= 2.2.5)
38
+ drb
39
+ i18n (>= 1.6, < 2)
40
+ minitest (>= 5.1)
41
+ mutex_m
42
+ tzinfo (~> 2.0)
43
+ addressable (2.8.6)
44
+ public_suffix (>= 2.0.2, < 6.0)
45
+ administrate (0.20.0)
46
+ actionpack (>= 6.0, < 8.0)
47
+ actionview (>= 6.0, < 8.0)
48
+ activerecord (>= 6.0, < 8.0)
49
+ jquery-rails (~> 4.6.0)
50
+ kaminari (~> 1.2.2)
51
+ sassc-rails (~> 2.1)
52
+ selectize-rails (~> 0.6)
53
+ appraisal (2.5.0)
54
+ bundler
55
+ rake
56
+ thor (>= 0.14.0)
57
+ ast (2.4.2)
58
+ base64 (0.2.0)
59
+ better_html (2.0.2)
60
+ actionview (>= 6.0)
61
+ activesupport (>= 6.0)
62
+ ast (~> 2.0)
63
+ erubi (~> 1.4)
64
+ parser (>= 2.4)
65
+ smart_properties
66
+ bigdecimal (3.1.6)
67
+ builder (3.2.4)
68
+ capybara (3.39.2)
69
+ addressable
70
+ matrix
71
+ mini_mime (>= 0.1.3)
72
+ nokogiri (~> 1.8)
73
+ rack (>= 1.6.0)
74
+ rack-test (>= 0.6.3)
75
+ regexp_parser (>= 1.5, < 3.0)
76
+ xpath (~> 3.2)
77
+ cocoon (1.2.15)
78
+ concurrent-ruby (1.2.3)
79
+ connection_pool (2.4.1)
80
+ crass (1.0.6)
81
+ diff-lcs (1.5.0)
82
+ drb (2.2.0)
83
+ ruby2_keywords
84
+ erubi (1.12.0)
85
+ factory_bot (6.4.5)
86
+ activesupport (>= 5.0.0)
87
+ ffi (1.16.3)
88
+ highline (3.0.1)
89
+ i18n (1.14.1)
90
+ concurrent-ruby (~> 1.0)
91
+ i18n-tasks (1.0.13)
92
+ activesupport (>= 4.0.2)
93
+ ast (>= 2.1.0)
94
+ better_html (>= 1.0, < 3.0)
95
+ erubi
96
+ highline (>= 2.0.0)
97
+ i18n
98
+ parser (>= 3.2.2.1)
99
+ rails-i18n
100
+ rainbow (>= 2.2.2, < 4.0)
101
+ terminal-table (>= 1.5.1)
102
+ io-console (0.7.2)
103
+ irb (1.11.1)
104
+ rdoc
105
+ reline (>= 0.4.2)
106
+ jquery-rails (4.6.0)
107
+ rails-dom-testing (>= 1, < 3)
108
+ railties (>= 4.2.0)
109
+ thor (>= 0.14, < 2.0)
110
+ kaminari (1.2.2)
111
+ activesupport (>= 4.1.0)
112
+ kaminari-actionview (= 1.2.2)
113
+ kaminari-activerecord (= 1.2.2)
114
+ kaminari-core (= 1.2.2)
115
+ kaminari-actionview (1.2.2)
116
+ actionview
117
+ kaminari-core (= 1.2.2)
118
+ kaminari-activerecord (1.2.2)
119
+ activerecord
120
+ kaminari-core (= 1.2.2)
121
+ kaminari-core (1.2.2)
122
+ loofah (2.22.0)
123
+ crass (~> 1.0.2)
124
+ nokogiri (>= 1.12.0)
125
+ matrix (0.4.2)
126
+ mini_mime (1.1.5)
127
+ minitest (5.21.2)
128
+ mutex_m (0.2.0)
129
+ nokogiri (1.16.0-aarch64-linux)
130
+ racc (~> 1.4)
131
+ nokogiri (1.16.0-arm-linux)
132
+ racc (~> 1.4)
133
+ nokogiri (1.16.0-arm64-darwin)
134
+ racc (~> 1.4)
135
+ nokogiri (1.16.0-x86-linux)
136
+ racc (~> 1.4)
137
+ nokogiri (1.16.0-x86_64-darwin)
138
+ racc (~> 1.4)
139
+ nokogiri (1.16.0-x86_64-linux)
140
+ racc (~> 1.4)
141
+ parser (3.3.0.5)
142
+ ast (~> 2.4.1)
143
+ racc
144
+ pg (1.5.4)
145
+ psych (5.1.2)
146
+ stringio
147
+ public_suffix (5.0.4)
148
+ racc (1.7.3)
149
+ rack (3.0.8)
150
+ rack-session (2.0.0)
151
+ rack (>= 3.0.0)
152
+ rack-test (2.1.0)
153
+ rack (>= 1.3)
154
+ rackup (2.1.0)
155
+ rack (>= 3)
156
+ webrick (~> 1.8)
157
+ rails-dom-testing (2.2.0)
158
+ activesupport (>= 5.0.0)
159
+ minitest
160
+ nokogiri (>= 1.6)
161
+ rails-html-sanitizer (1.6.0)
162
+ loofah (~> 2.21)
163
+ nokogiri (~> 1.14)
164
+ rails-i18n (7.0.8)
165
+ i18n (>= 0.7, < 2)
166
+ railties (>= 6.0.0, < 8)
167
+ railties (7.1.3)
168
+ actionpack (= 7.1.3)
169
+ activesupport (= 7.1.3)
170
+ irb
171
+ rackup (>= 1.0.0)
172
+ rake (>= 12.2)
173
+ thor (~> 1.0, >= 1.2.2)
174
+ zeitwerk (~> 2.6)
175
+ rainbow (3.1.1)
176
+ rake (13.1.0)
177
+ rdoc (6.6.2)
178
+ psych (>= 4.0.0)
179
+ regexp_parser (2.9.0)
180
+ reline (0.4.2)
181
+ io-console (~> 0.5)
182
+ rexml (3.2.6)
183
+ rspec-core (3.12.2)
184
+ rspec-support (~> 3.12.0)
185
+ rspec-expectations (3.12.3)
186
+ diff-lcs (>= 1.2.0, < 2.0)
187
+ rspec-support (~> 3.12.0)
188
+ rspec-mocks (3.12.6)
189
+ diff-lcs (>= 1.2.0, < 2.0)
190
+ rspec-support (~> 3.12.0)
191
+ rspec-rails (6.1.1)
192
+ actionpack (>= 6.1)
193
+ activesupport (>= 6.1)
194
+ railties (>= 6.1)
195
+ rspec-core (~> 3.12)
196
+ rspec-expectations (~> 3.12)
197
+ rspec-mocks (~> 3.12)
198
+ rspec-support (~> 3.12)
199
+ rspec-support (3.12.1)
200
+ ruby2_keywords (0.0.5)
201
+ rubyzip (2.3.2)
202
+ sassc (2.4.0)
203
+ ffi (~> 1.9)
204
+ sassc-rails (2.1.2)
205
+ railties (>= 4.0.0)
206
+ sassc (>= 2.0)
207
+ sprockets (> 3.0)
208
+ sprockets-rails
209
+ tilt
210
+ selectize-rails (0.12.6)
211
+ selenium-webdriver (4.17.0)
212
+ base64 (~> 0.2)
213
+ rexml (~> 3.2, >= 3.2.5)
214
+ rubyzip (>= 1.2.2, < 3.0)
215
+ websocket (~> 1.0)
216
+ smart_properties (1.17.0)
217
+ sprockets (4.2.1)
218
+ concurrent-ruby (~> 1.0)
219
+ rack (>= 2.2.4, < 4)
220
+ sprockets-rails (3.4.2)
221
+ actionpack (>= 5.2)
222
+ activesupport (>= 5.2)
223
+ sprockets (>= 3.0.0)
224
+ stringio (3.1.0)
225
+ terminal-table (3.0.2)
226
+ unicode-display_width (>= 1.1.1, < 3)
227
+ thor (1.3.0)
228
+ tilt (2.3.0)
229
+ timeout (0.4.1)
230
+ tzinfo (2.0.6)
231
+ concurrent-ruby (~> 1.0)
232
+ unicode-display_width (2.5.0)
233
+ webrick (1.8.1)
234
+ websocket (1.2.10)
235
+ xpath (3.2.0)
236
+ nokogiri (~> 1.8)
237
+ zeitwerk (2.6.12)
238
+
239
+ PLATFORMS
240
+ aarch64-linux
241
+ arm-linux
242
+ arm64-darwin
243
+ x86-linux
244
+ x86_64-darwin
245
+ x86_64-linux
246
+
247
+ DEPENDENCIES
248
+ administrate (= 0.20.0)
249
+ administrate-field-nested_has_many!
250
+ appraisal
251
+ capybara
252
+ factory_bot
253
+ i18n-tasks
254
+ pg
255
+ rake
256
+ rspec-rails
257
+ selenium-webdriver
258
+
259
+ BUNDLED WITH
260
+ 2.5.3
@@ -3,6 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "pg"
6
- gem "administrate", git: "https://github.com/thoughtbot/administrate", branch: "master"
6
+ gem "administrate", git: "https://github.com/thoughtbot/administrate", branch: "main"
7
7
 
8
8
  gemspec path: "../"
@@ -0,0 +1,266 @@
1
+ GIT
2
+ remote: https://github.com/thoughtbot/administrate
3
+ revision: aa923813e4ea48dc9f4eb2c748875580ae4c5012
4
+ branch: main
5
+ specs:
6
+ administrate (0.20.1)
7
+ actionpack (>= 6.0, < 8.0)
8
+ actionview (>= 6.0, < 8.0)
9
+ activerecord (>= 6.0, < 8.0)
10
+ jquery-rails (~> 4.6.0)
11
+ kaminari (~> 1.2.2)
12
+ sassc-rails (~> 2.1)
13
+ selectize-rails (~> 0.6)
14
+
15
+ PATH
16
+ remote: ..
17
+ specs:
18
+ administrate-field-nested_has_many (2.1.0)
19
+ administrate (>= 0.19, < 1)
20
+ cocoon (~> 1.2, >= 1.2.11)
21
+
22
+ GEM
23
+ remote: https://rubygems.org/
24
+ specs:
25
+ actionpack (7.1.3)
26
+ actionview (= 7.1.3)
27
+ activesupport (= 7.1.3)
28
+ nokogiri (>= 1.8.5)
29
+ racc
30
+ rack (>= 2.2.4)
31
+ rack-session (>= 1.0.1)
32
+ rack-test (>= 0.6.3)
33
+ rails-dom-testing (~> 2.2)
34
+ rails-html-sanitizer (~> 1.6)
35
+ actionview (7.1.3)
36
+ activesupport (= 7.1.3)
37
+ builder (~> 3.1)
38
+ erubi (~> 1.11)
39
+ rails-dom-testing (~> 2.2)
40
+ rails-html-sanitizer (~> 1.6)
41
+ activemodel (7.1.3)
42
+ activesupport (= 7.1.3)
43
+ activerecord (7.1.3)
44
+ activemodel (= 7.1.3)
45
+ activesupport (= 7.1.3)
46
+ timeout (>= 0.4.0)
47
+ activesupport (7.1.3)
48
+ base64
49
+ bigdecimal
50
+ concurrent-ruby (~> 1.0, >= 1.0.2)
51
+ connection_pool (>= 2.2.5)
52
+ drb
53
+ i18n (>= 1.6, < 2)
54
+ minitest (>= 5.1)
55
+ mutex_m
56
+ tzinfo (~> 2.0)
57
+ addressable (2.8.6)
58
+ public_suffix (>= 2.0.2, < 6.0)
59
+ appraisal (2.5.0)
60
+ bundler
61
+ rake
62
+ thor (>= 0.14.0)
63
+ ast (2.4.2)
64
+ base64 (0.2.0)
65
+ better_html (2.0.2)
66
+ actionview (>= 6.0)
67
+ activesupport (>= 6.0)
68
+ ast (~> 2.0)
69
+ erubi (~> 1.4)
70
+ parser (>= 2.4)
71
+ smart_properties
72
+ bigdecimal (3.1.6)
73
+ builder (3.2.4)
74
+ capybara (3.39.2)
75
+ addressable
76
+ matrix
77
+ mini_mime (>= 0.1.3)
78
+ nokogiri (~> 1.8)
79
+ rack (>= 1.6.0)
80
+ rack-test (>= 0.6.3)
81
+ regexp_parser (>= 1.5, < 3.0)
82
+ xpath (~> 3.2)
83
+ cocoon (1.2.15)
84
+ concurrent-ruby (1.2.3)
85
+ connection_pool (2.4.1)
86
+ crass (1.0.6)
87
+ diff-lcs (1.5.0)
88
+ drb (2.2.0)
89
+ ruby2_keywords
90
+ erubi (1.12.0)
91
+ factory_bot (6.4.5)
92
+ activesupport (>= 5.0.0)
93
+ ffi (1.16.3)
94
+ highline (3.0.1)
95
+ i18n (1.14.1)
96
+ concurrent-ruby (~> 1.0)
97
+ i18n-tasks (1.0.13)
98
+ activesupport (>= 4.0.2)
99
+ ast (>= 2.1.0)
100
+ better_html (>= 1.0, < 3.0)
101
+ erubi
102
+ highline (>= 2.0.0)
103
+ i18n
104
+ parser (>= 3.2.2.1)
105
+ rails-i18n
106
+ rainbow (>= 2.2.2, < 4.0)
107
+ terminal-table (>= 1.5.1)
108
+ io-console (0.7.2)
109
+ irb (1.11.1)
110
+ rdoc
111
+ reline (>= 0.4.2)
112
+ jquery-rails (4.6.0)
113
+ rails-dom-testing (>= 1, < 3)
114
+ railties (>= 4.2.0)
115
+ thor (>= 0.14, < 2.0)
116
+ kaminari (1.2.2)
117
+ activesupport (>= 4.1.0)
118
+ kaminari-actionview (= 1.2.2)
119
+ kaminari-activerecord (= 1.2.2)
120
+ kaminari-core (= 1.2.2)
121
+ kaminari-actionview (1.2.2)
122
+ actionview
123
+ kaminari-core (= 1.2.2)
124
+ kaminari-activerecord (1.2.2)
125
+ activerecord
126
+ kaminari-core (= 1.2.2)
127
+ kaminari-core (1.2.2)
128
+ loofah (2.22.0)
129
+ crass (~> 1.0.2)
130
+ nokogiri (>= 1.12.0)
131
+ matrix (0.4.2)
132
+ mini_mime (1.1.5)
133
+ minitest (5.21.2)
134
+ mutex_m (0.2.0)
135
+ nokogiri (1.16.0-aarch64-linux)
136
+ racc (~> 1.4)
137
+ nokogiri (1.16.0-arm-linux)
138
+ racc (~> 1.4)
139
+ nokogiri (1.16.0-arm64-darwin)
140
+ racc (~> 1.4)
141
+ nokogiri (1.16.0-x86-linux)
142
+ racc (~> 1.4)
143
+ nokogiri (1.16.0-x86_64-darwin)
144
+ racc (~> 1.4)
145
+ nokogiri (1.16.0-x86_64-linux)
146
+ racc (~> 1.4)
147
+ parser (3.3.0.5)
148
+ ast (~> 2.4.1)
149
+ racc
150
+ pg (1.5.4)
151
+ psych (5.1.2)
152
+ stringio
153
+ public_suffix (5.0.4)
154
+ racc (1.7.3)
155
+ rack (3.0.8)
156
+ rack-session (2.0.0)
157
+ rack (>= 3.0.0)
158
+ rack-test (2.1.0)
159
+ rack (>= 1.3)
160
+ rackup (2.1.0)
161
+ rack (>= 3)
162
+ webrick (~> 1.8)
163
+ rails-dom-testing (2.2.0)
164
+ activesupport (>= 5.0.0)
165
+ minitest
166
+ nokogiri (>= 1.6)
167
+ rails-html-sanitizer (1.6.0)
168
+ loofah (~> 2.21)
169
+ nokogiri (~> 1.14)
170
+ rails-i18n (7.0.8)
171
+ i18n (>= 0.7, < 2)
172
+ railties (>= 6.0.0, < 8)
173
+ railties (7.1.3)
174
+ actionpack (= 7.1.3)
175
+ activesupport (= 7.1.3)
176
+ irb
177
+ rackup (>= 1.0.0)
178
+ rake (>= 12.2)
179
+ thor (~> 1.0, >= 1.2.2)
180
+ zeitwerk (~> 2.6)
181
+ rainbow (3.1.1)
182
+ rake (13.1.0)
183
+ rdoc (6.6.2)
184
+ psych (>= 4.0.0)
185
+ regexp_parser (2.9.0)
186
+ reline (0.4.2)
187
+ io-console (~> 0.5)
188
+ rexml (3.2.6)
189
+ rspec-core (3.12.2)
190
+ rspec-support (~> 3.12.0)
191
+ rspec-expectations (3.12.3)
192
+ diff-lcs (>= 1.2.0, < 2.0)
193
+ rspec-support (~> 3.12.0)
194
+ rspec-mocks (3.12.6)
195
+ diff-lcs (>= 1.2.0, < 2.0)
196
+ rspec-support (~> 3.12.0)
197
+ rspec-rails (6.1.1)
198
+ actionpack (>= 6.1)
199
+ activesupport (>= 6.1)
200
+ railties (>= 6.1)
201
+ rspec-core (~> 3.12)
202
+ rspec-expectations (~> 3.12)
203
+ rspec-mocks (~> 3.12)
204
+ rspec-support (~> 3.12)
205
+ rspec-support (3.12.1)
206
+ ruby2_keywords (0.0.5)
207
+ rubyzip (2.3.2)
208
+ sassc (2.4.0)
209
+ ffi (~> 1.9)
210
+ sassc-rails (2.1.2)
211
+ railties (>= 4.0.0)
212
+ sassc (>= 2.0)
213
+ sprockets (> 3.0)
214
+ sprockets-rails
215
+ tilt
216
+ selectize-rails (0.12.6)
217
+ selenium-webdriver (4.17.0)
218
+ base64 (~> 0.2)
219
+ rexml (~> 3.2, >= 3.2.5)
220
+ rubyzip (>= 1.2.2, < 3.0)
221
+ websocket (~> 1.0)
222
+ smart_properties (1.17.0)
223
+ sprockets (4.2.1)
224
+ concurrent-ruby (~> 1.0)
225
+ rack (>= 2.2.4, < 4)
226
+ sprockets-rails (3.4.2)
227
+ actionpack (>= 5.2)
228
+ activesupport (>= 5.2)
229
+ sprockets (>= 3.0.0)
230
+ stringio (3.1.0)
231
+ terminal-table (3.0.2)
232
+ unicode-display_width (>= 1.1.1, < 3)
233
+ thor (1.3.0)
234
+ tilt (2.3.0)
235
+ timeout (0.4.1)
236
+ tzinfo (2.0.6)
237
+ concurrent-ruby (~> 1.0)
238
+ unicode-display_width (2.5.0)
239
+ webrick (1.8.1)
240
+ websocket (1.2.10)
241
+ xpath (3.2.0)
242
+ nokogiri (~> 1.8)
243
+ zeitwerk (2.6.12)
244
+
245
+ PLATFORMS
246
+ aarch64-linux
247
+ arm-linux
248
+ arm64-darwin
249
+ x86-linux
250
+ x86_64-darwin
251
+ x86_64-linux
252
+
253
+ DEPENDENCIES
254
+ administrate!
255
+ administrate-field-nested_has_many!
256
+ appraisal
257
+ capybara
258
+ factory_bot
259
+ i18n-tasks
260
+ pg
261
+ rake
262
+ rspec-rails
263
+ selenium-webdriver
264
+
265
+ BUNDLED WITH
266
+ 2.5.3
@@ -15,12 +15,25 @@ module Administrate
15
15
  Administrate::Engine.add_stylesheet(
16
16
  "administrate-field-nested_has_many/application",
17
17
  )
18
+
19
+ initializer "administrate-field-nested_has_many.assets.precompile" do |app|
20
+ app.config.assets.precompile += [
21
+ "administrate-field-nested_has_many/application.js",
22
+ "administrate-field-nested_has_many/application.css",
23
+ ]
24
+ end
18
25
  end
19
26
 
20
27
  DEFAULT_ATTRIBUTES = %i(id _destroy).freeze
21
28
 
22
29
  def nested_fields
23
- associated_form.attributes.reject do |nested_field|
30
+ all_fields = if Administrate::VERSION >= "0.20.0"
31
+ associated_form.attributes.values.flatten
32
+ else
33
+ associated_form.attributes
34
+ end
35
+
36
+ all_fields.reject do |nested_field|
24
37
  skipped_fields.include?(nested_field.attribute)
25
38
  end
26
39
  end
@@ -44,32 +57,39 @@ module Administrate
44
57
  data
45
58
  end
46
59
 
47
- def self.dashboard_for_resource(resource, options)
48
- class_name = options && options[:class_name] || resource.to_s.classify
49
- "#{class_name}Dashboard".constantize
60
+ def self.dashboard_for_resource(resource_class, attr)
61
+ "#{associated_class_name(resource_class, attr)}Dashboard".constantize
50
62
  end
51
63
 
52
- def self.associated_attributes(associated_resource, options)
53
- dashboard_class = dashboard_for_resource(associated_resource, options)
64
+ def self.associated_attributes(resource_class, attr)
65
+ dashboard_class = dashboard_for_resource(resource_class, attr)
54
66
  DEFAULT_ATTRIBUTES + dashboard_class.new.permitted_attributes
55
67
  end
56
68
 
57
- def self.permitted_attribute(associated_resource, options = nil)
69
+ def self.permitted_attribute(attr, options = {})
70
+ given_class_name = options[:class_name]
71
+ _resource_class =
72
+ if given_class_name
73
+ Administrate.warn_of_deprecated_option(:class_name)
74
+ given_class_name.classify
75
+ else
76
+ options[:resource_class]
77
+ end
78
+
58
79
  {
59
- "#{associated_resource}_attributes".to_sym =>
60
- associated_attributes(associated_resource, options),
80
+ "#{attr}_attributes".to_sym =>
81
+ associated_attributes(_resource_class, attr),
61
82
  }
62
83
  end
63
84
 
64
85
  def associated_class_name
65
- options.fetch(:class_name, attribute.to_s.singularize.camelcase)
86
+ self.class.associated_class_name(resource.class, attribute)
66
87
  end
67
88
 
68
89
  def association_name
69
- options.fetch(
70
- :association_name,
71
- associated_class_name.underscore.pluralize[/([^\/]*)$/, 1],
72
- )
90
+ options.fetch(:association_name) do
91
+ associated_class_name.underscore.pluralize[/([^\/]*)$/, 1]
92
+ end
73
93
  end
74
94
 
75
95
  def associated_form
@@ -79,7 +99,7 @@ module Administrate
79
99
  private
80
100
 
81
101
  def new_resource
82
- @new_resource ||= associated_class_name.constantize.new
102
+ @new_resource ||= associated_class.new
83
103
  end
84
104
 
85
105
  def skipped_fields
data/spec/dummy/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
- require_relative 'config/application'
4
+ require_relative "config/application"
5
5
 
6
6
  Rails.application.load_tasks
@@ -10,7 +10,7 @@ class SchoolDashboard < Administrate::BaseDashboard
10
10
  ATTRIBUTE_TYPES = {
11
11
  id: Field::Number,
12
12
  name: Field::String,
13
- students: Field::NestedHasMany.with_options(class_name: "Foo::Student"),
13
+ students: Field::NestedHasMany,
14
14
  created_at: Field::DateTime,
15
15
  updated_at: Field::DateTime,
16
16
  }.freeze
data/spec/dummy/bin/rails CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  APP_PATH = File.expand_path('../config/application', __dir__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
3
+ require_relative "../config/boot"
4
+ require "rails/commands"
data/spec/dummy/bin/rake CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
2
+ require_relative "../config/boot"
3
+ require "rake"
4
4
  Rake.application.run
data/spec/dummy/bin/setup CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require 'fileutils'
3
- include FileUtils
2
+ require "fileutils"
4
3
 
5
4
  # path to your application root.
6
5
  APP_ROOT = File.expand_path('..', __dir__)
@@ -9,24 +8,22 @@ def system!(*args)
9
8
  system(*args) || abort("\n== Command #{args} failed ==")
10
9
  end
11
10
 
12
- chdir APP_ROOT do
13
- # This script is a starting point to setup your application.
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to set up or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14
14
  # Add necessary setup steps to this file.
15
15
 
16
16
  puts '== Installing dependencies =='
17
17
  system! 'gem install bundler --conservative'
18
18
  system('bundle check') || system!('bundle install')
19
19
 
20
- # Install JavaScript dependencies if using Yarn
21
- # system('bin/yarn')
22
-
23
20
  # puts "\n== Copying sample files =="
24
21
  # unless File.exist?('config/database.yml')
25
- # cp 'config/database.yml.sample', 'config/database.yml'
22
+ # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
26
23
  # end
27
24
 
28
25
  puts "\n== Preparing database =="
29
- system! 'bin/rails db:setup'
26
+ system! 'bin/rails db:prepare'
30
27
 
31
28
  puts "\n== Removing old logs and tempfiles =="
32
29
  system! 'bin/rails log:clear tmp:clear'