Skip to content

Commit 633080b

Browse files
committed
Fix admin interface User state can't save.
1 parent cfbab65 commit 633080b

File tree

4 files changed

+92
-86
lines changed

4 files changed

+92
-86
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ source "https://rubygems.org"
33
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
44

55
gem "jbuilder"
6-
gem "rails", "~> 8.0.0.beta1"
6+
gem "rails", "~> 8"
77
gem "rails_autolink"
88
gem "sass-rails"
99
gem "shakapacker", "~> 7.2.1"
1010
gem "turbolinks"
1111
gem "uglifier"
1212

13-
gem "view_component", "~> 2.83"
13+
gem "view_component"
1414

1515
gem "pg"
1616

Gemfile.lock

Lines changed: 88 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,65 @@ GEM
33
specs:
44
action-store (1.1.3)
55
rails (>= 5.2)
6-
actioncable (8.0.0.rc2)
7-
actionpack (= 8.0.0.rc2)
8-
activesupport (= 8.0.0.rc2)
6+
actioncable (8.0.2)
7+
actionpack (= 8.0.2)
8+
activesupport (= 8.0.2)
99
nio4r (~> 2.0)
1010
websocket-driver (>= 0.6.1)
1111
zeitwerk (~> 2.6)
12-
actionmailbox (8.0.0.rc2)
13-
actionpack (= 8.0.0.rc2)
14-
activejob (= 8.0.0.rc2)
15-
activerecord (= 8.0.0.rc2)
16-
activestorage (= 8.0.0.rc2)
17-
activesupport (= 8.0.0.rc2)
12+
actionmailbox (8.0.2)
13+
actionpack (= 8.0.2)
14+
activejob (= 8.0.2)
15+
activerecord (= 8.0.2)
16+
activestorage (= 8.0.2)
17+
activesupport (= 8.0.2)
1818
mail (>= 2.8.0)
19-
actionmailer (8.0.0.rc2)
20-
actionpack (= 8.0.0.rc2)
21-
actionview (= 8.0.0.rc2)
22-
activejob (= 8.0.0.rc2)
23-
activesupport (= 8.0.0.rc2)
19+
actionmailer (8.0.2)
20+
actionpack (= 8.0.2)
21+
actionview (= 8.0.2)
22+
activejob (= 8.0.2)
23+
activesupport (= 8.0.2)
2424
mail (>= 2.8.0)
2525
rails-dom-testing (~> 2.2)
26-
actionpack (8.0.0.rc2)
27-
actionview (= 8.0.0.rc2)
28-
activesupport (= 8.0.0.rc2)
26+
actionpack (8.0.2)
27+
actionview (= 8.0.2)
28+
activesupport (= 8.0.2)
2929
nokogiri (>= 1.8.5)
3030
rack (>= 2.2.4)
3131
rack-session (>= 1.0.1)
3232
rack-test (>= 0.6.3)
3333
rails-dom-testing (~> 2.2)
3434
rails-html-sanitizer (~> 1.6)
3535
useragent (~> 0.16)
36-
actiontext (8.0.0.rc2)
37-
actionpack (= 8.0.0.rc2)
38-
activerecord (= 8.0.0.rc2)
39-
activestorage (= 8.0.0.rc2)
40-
activesupport (= 8.0.0.rc2)
36+
actiontext (8.0.2)
37+
actionpack (= 8.0.2)
38+
activerecord (= 8.0.2)
39+
activestorage (= 8.0.2)
40+
activesupport (= 8.0.2)
4141
globalid (>= 0.6.0)
4242
nokogiri (>= 1.8.5)
43-
actionview (8.0.0.rc2)
44-
activesupport (= 8.0.0.rc2)
43+
actionview (8.0.2)
44+
activesupport (= 8.0.2)
4545
builder (~> 3.1)
4646
erubi (~> 1.11)
4747
rails-dom-testing (~> 2.2)
4848
rails-html-sanitizer (~> 1.6)
49-
activejob (8.0.0.rc2)
50-
activesupport (= 8.0.0.rc2)
49+
activejob (8.0.2)
50+
activesupport (= 8.0.2)
5151
globalid (>= 0.3.6)
52-
activemodel (8.0.0.rc2)
53-
activesupport (= 8.0.0.rc2)
54-
activerecord (8.0.0.rc2)
55-
activemodel (= 8.0.0.rc2)
56-
activesupport (= 8.0.0.rc2)
52+
activemodel (8.0.2)
53+
activesupport (= 8.0.2)
54+
activerecord (8.0.2)
55+
activemodel (= 8.0.2)
56+
activesupport (= 8.0.2)
5757
timeout (>= 0.4.0)
58-
activestorage (8.0.0.rc2)
59-
actionpack (= 8.0.0.rc2)
60-
activejob (= 8.0.0.rc2)
61-
activerecord (= 8.0.0.rc2)
62-
activesupport (= 8.0.0.rc2)
58+
activestorage (8.0.2)
59+
actionpack (= 8.0.2)
60+
activejob (= 8.0.2)
61+
activerecord (= 8.0.2)
62+
activesupport (= 8.0.2)
6363
marcel (~> 1.0)
64-
activesupport (8.0.0.rc2)
64+
activesupport (8.0.2)
6565
base64
6666
benchmark (>= 0.3)
6767
bigdecimal
@@ -124,10 +124,10 @@ GEM
124124
coffee-script-source
125125
execjs
126126
coffee-script-source (1.12.2)
127-
concurrent-ruby (1.3.4)
128-
connection_pool (2.4.1)
127+
concurrent-ruby (1.3.5)
128+
connection_pool (2.5.0)
129129
crass (1.0.6)
130-
date (3.3.4)
130+
date (3.4.1)
131131
derailed_benchmarks (2.2.1)
132132
base64
133133
benchmark-ips (~> 2)
@@ -208,13 +208,14 @@ GEM
208208
http-cookie (1.0.7)
209209
domain_name (~> 0.5)
210210
http_accept_language (2.1.1)
211-
i18n (1.14.6)
211+
i18n (1.14.7)
212212
concurrent-ruby (~> 1.0)
213213
image_processing (1.13.0)
214214
mini_magick (>= 4.9.5, < 5)
215215
ruby-vips (>= 2.0.17, < 3)
216216
io-console (0.8.0)
217-
irb (1.14.3)
217+
irb (1.15.1)
218+
pp (>= 0.6.0)
218219
rdoc (>= 4.0.0)
219220
reline (>= 0.4.2)
220221
jbuilder (2.13.0)
@@ -245,8 +246,8 @@ GEM
245246
listen (3.9.0)
246247
rb-fsevent (~> 0.10, >= 0.10.3)
247248
rb-inotify (~> 0.9, >= 0.9.10)
248-
logger (1.6.4)
249-
loofah (2.23.1)
249+
logger (1.6.6)
250+
loofah (2.24.0)
250251
crass (~> 1.0.2)
251252
nokogiri (>= 1.12.0)
252253
mail (2.8.1)
@@ -264,7 +265,7 @@ GEM
264265
mini_histogram (0.3.1)
265266
mini_magick (4.13.2)
266267
mini_mime (1.1.5)
267-
minitest (5.25.4)
268+
minitest (5.25.5)
268269
minitest-spec-rails (7.3.0)
269270
minitest (>= 5.0)
270271
railties (>= 4.1)
@@ -276,24 +277,24 @@ GEM
276277
mutex_m (0.2.0)
277278
net-http (0.4.1)
278279
uri
279-
net-imap (0.5.0)
280+
net-imap (0.5.6)
280281
date
281282
net-protocol
282283
net-pop (0.1.2)
283284
net-protocol
284285
net-protocol (0.2.2)
285286
timeout
286-
net-smtp (0.5.0)
287+
net-smtp (0.5.1)
287288
net-protocol
288289
netrc (0.11.0)
289290
nio4r (2.7.4)
290-
nokogiri (1.18.1-aarch64-linux-musl)
291+
nokogiri (1.18.3-aarch64-linux-musl)
291292
racc (~> 1.4)
292-
nokogiri (1.18.1-arm64-darwin)
293+
nokogiri (1.18.3-arm64-darwin)
293294
racc (~> 1.4)
294-
nokogiri (1.18.1-x86_64-linux-gnu)
295+
nokogiri (1.18.3-x86_64-linux-gnu)
295296
racc (~> 1.4)
296-
nokogiri (1.18.1-x86_64-linux-musl)
297+
nokogiri (1.18.3-x86_64-linux-musl)
297298
racc (~> 1.4)
298299
notifications (1.1.0)
299300
kaminari (>= 0.15)
@@ -348,7 +349,10 @@ GEM
348349
postmark-rails (0.22.1)
349350
actionmailer (>= 3.0.0)
350351
postmark (>= 1.21.3, < 2.0)
351-
psych (5.2.2)
352+
pp (0.6.2)
353+
prettyprint
354+
prettyprint (0.2.0)
355+
psych (5.2.3)
352356
date
353357
stringio
354358
public_suffix (6.0.1)
@@ -364,7 +368,7 @@ GEM
364368
rexml (~> 3.2)
365369
raabro (1.4.0)
366370
racc (1.8.1)
367-
rack (3.1.8)
371+
rack (3.1.12)
368372
rack-attack (6.7.0)
369373
rack (>= 1.0, < 4)
370374
rack-cors (2.0.2)
@@ -374,46 +378,47 @@ GEM
374378
rack (>= 3.0.0, < 4)
375379
rack-proxy (0.7.7)
376380
rack
377-
rack-session (2.0.0)
381+
rack-session (2.1.0)
382+
base64 (>= 0.1.0)
378383
rack (>= 3.0.0)
379384
rack-test (2.2.0)
380385
rack (>= 1.3)
381386
rackup (2.2.1)
382387
rack (>= 3)
383-
rails (8.0.0.rc2)
384-
actioncable (= 8.0.0.rc2)
385-
actionmailbox (= 8.0.0.rc2)
386-
actionmailer (= 8.0.0.rc2)
387-
actionpack (= 8.0.0.rc2)
388-
actiontext (= 8.0.0.rc2)
389-
actionview (= 8.0.0.rc2)
390-
activejob (= 8.0.0.rc2)
391-
activemodel (= 8.0.0.rc2)
392-
activerecord (= 8.0.0.rc2)
393-
activestorage (= 8.0.0.rc2)
394-
activesupport (= 8.0.0.rc2)
388+
rails (8.0.2)
389+
actioncable (= 8.0.2)
390+
actionmailbox (= 8.0.2)
391+
actionmailer (= 8.0.2)
392+
actionpack (= 8.0.2)
393+
actiontext (= 8.0.2)
394+
actionview (= 8.0.2)
395+
activejob (= 8.0.2)
396+
activemodel (= 8.0.2)
397+
activerecord (= 8.0.2)
398+
activestorage (= 8.0.2)
399+
activesupport (= 8.0.2)
395400
bundler (>= 1.15.0)
396-
railties (= 8.0.0.rc2)
401+
railties (= 8.0.2)
397402
rails-dom-testing (2.2.0)
398403
activesupport (>= 5.0.0)
399404
minitest
400405
nokogiri (>= 1.6)
401406
rails-html-sanitizer (1.6.2)
402407
loofah (~> 2.21)
403408
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)
404-
rails-i18n (7.0.10)
409+
rails-i18n (8.0.1)
405410
i18n (>= 0.7, < 2)
406-
railties (>= 6.0.0, < 8)
411+
railties (>= 8.0.0, < 9)
407412
rails-settings-cached (2.9.5)
408413
activerecord (>= 5.0.0)
409414
railties (>= 5.0.0)
410415
rails_autolink (1.1.8)
411416
actionview (> 3.1)
412417
activesupport (> 3.1)
413418
railties (> 3.1)
414-
railties (8.0.0.rc2)
415-
actionpack (= 8.0.0.rc2)
416-
activesupport (= 8.0.0.rc2)
419+
railties (8.0.2)
420+
actionpack (= 8.0.2)
421+
activesupport (= 8.0.2)
417422
irb (~> 1.13)
418423
rackup (>= 1.0.0)
419424
rake (>= 12.2)
@@ -425,7 +430,7 @@ GEM
425430
rb-inotify (0.11.1)
426431
ffi (~> 1.0)
427432
rb_sys (0.9.105)
428-
rdoc (6.10.0)
433+
rdoc (6.12.0)
429434
psych (>= 4.0.0)
430435
recaptcha (5.17.0)
431436
redcarpet (3.6.0)
@@ -535,10 +540,10 @@ GEM
535540
activesupport (>= 6.1)
536541
sprockets (>= 3.0.0)
537542
ssrf_filter (1.1.2)
538-
stringio (3.1.2)
543+
stringio (3.1.5)
539544
thor (1.3.2)
540545
tilt (2.4.0)
541-
timeout (0.4.1)
546+
timeout (0.4.3)
542547
turbolinks (5.2.1)
543548
turbolinks-source (~> 5.2)
544549
turbolinks-source (5.2.0)
@@ -549,19 +554,20 @@ GEM
549554
uglifier (4.2.1)
550555
execjs (>= 0.3.0, < 3)
551556
unicode-display_width (2.6.0)
552-
uri (1.0.2)
557+
uri (1.0.3)
553558
useragent (0.16.11)
554559
version_gem (1.1.4)
555-
view_component (2.83.0)
556-
activesupport (>= 5.2.0, < 8.0)
560+
view_component (3.21.0)
561+
activesupport (>= 5.2.0, < 8.1)
557562
concurrent-ruby (~> 1.0)
558563
method_source (~> 1.0)
559564
warden (1.2.9)
560565
rack (>= 2.0.9)
561-
websocket-driver (0.7.6)
566+
websocket-driver (0.7.7)
567+
base64
562568
websocket-extensions (>= 0.1.0)
563569
websocket-extensions (0.1.5)
564-
zeitwerk (2.7.1)
570+
zeitwerk (2.7.2)
565571

566572
PLATFORMS
567573
aarch64-linux-musl
@@ -619,7 +625,7 @@ DEPENDENCIES
619625
qiniu
620626
rack-attack
621627
rack-cors
622-
rails (~> 8.0.0.beta1)
628+
rails (~> 8)
623629
rails-i18n
624630
rails-settings-cached
625631
rails_autolink
@@ -639,7 +645,7 @@ DEPENDENCIES
639645
turbolinks
640646
twemoji
641647
uglifier
642-
view_component (~> 2.83)
648+
view_component
643649

644650
BUNDLED WITH
645651
2.6.2

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "digest/md5"
22

33
class User < ApplicationRecord
4-
include Searchable
4+
# include Searchable
55
include User::SoftDelete
66
include User::Avatar
77
include User::Deviseable

app/models/user/roles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Roles
77
enum :state, { deleted: -1, member: 1, blocked: 2, vip: 3, hr: 4, maintainer: 90, admin: 99 }
88

99
def self.state_options
10-
self.states.map { |key, value| [I18n.t("activerecord.enums.user.state.#{key}"), value] }
10+
self.states.map { |key, _| [I18n.t("activerecord.enums.user.state.#{key}"), key] }
1111
end
1212

1313
# user.admin?

0 commit comments

Comments
 (0)