ああ、ごめん。LLMが古い情報を提供していたみたい。
試して使ったコマンドをいくつか紹介するね。
管理者ユーザーと、予定されている変更に関する設定値をテーブル形式で表示するには:
# docker exec -it app rails r 'User.where(admin: true).each { |u| puts "#{u.id} #{u.username} #{u.user_option.enable_upcoming_change_available_notifications}" }'
-1 system true
-2 discobot true
1 AdminTeam false
特定のID(私の場合は1)について、そのIDの設定を切り替えるには:
# docker exec -it app rails r 'x=1;User.find(x).user_option.update!(enable_upcoming_change_available_notifications: !User.find(x).user_option.enable_upcoming_change_available_notifications)'
もちろん、dockerに入ってrailsに入り、そこで操作することも可能だが、私はルートシェルからのワンライナーの方が好みだ。