Skip to content

Commit

Permalink
マイグレーションできるようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
204504bySE committed Jul 7, 2023
1 parent f26a32f commit c8f9f13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ gem 'concurrent-ruby', require: false
gem 'connection_pool', require: false
gem 'xorcist', '~> 1.1'
gem 'cocoon', '~> 1.2'

# https://qiita.com/Bjp8kHYYPFq8MrI/items/90a9db03160f8d6f7e5c
gem 'psych', '~> 3.1'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ GEM
pry (>= 0.13, < 0.15)
pry-rails (0.3.9)
pry (>= 0.10.4)
psych (3.3.4)
public_suffix (5.0.1)
puma (5.6.5)
nio4r (~> 2.0)
Expand Down Expand Up @@ -838,6 +839,7 @@ DEPENDENCIES
private_address_check (~> 0.5)
pry-byebug (~> 3.10)
pry-rails (~> 0.3)
psych (~> 3.1)
public_suffix (~> 5.0)
puma (~> 5.6)
pundit (~> 2.3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def up
moderator_role = UserRole.find_by(name: 'Moderator')
everyone_role = UserRole.find_by(id: -99)

min_invite_role = Setting.min_invite_role
show_staff_badge = Setting.show_staff_badge
min_invite_role = owner_role #Setting.min_invite_role

Check failure on line 14 in db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Layout/LeadingCommentSpace: Missing space after #. (https://rubystyle.guide#hash-space)
show_staff_badge = true #Setting.show_staff_badge

Check failure on line 15 in db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Layout/LeadingCommentSpace: Missing space after #. (https://rubystyle.guide#hash-space)

if everyone_role
everyone_role.permissions &= ~::UserRole::FLAGS[:invite_users] unless min_invite_role == 'user'
Expand Down

0 comments on commit c8f9f13

Please sign in to comment.