このコミットが含まれているのは:
@@ -25,7 +25,11 @@ class UserSettingsController < ApplicationController
|
||||
private
|
||||
|
||||
def current_setting
|
||||
current_user.setting || current_user.create_setting!(Setting.defaults)
|
||||
Setting.find_or_create_by!(user: current_user) do |setting|
|
||||
setting.assign_attributes(Setting.defaults)
|
||||
end
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
Setting.find_by!(user: current_user)
|
||||
end
|
||||
|
||||
def validate_raw_attributes raw_attributes
|
||||
|
||||
@@ -15,7 +15,7 @@ class Setting < ApplicationRecord
|
||||
'updated_at_asc',
|
||||
'updated_at_desc',
|
||||
].freeze
|
||||
VIEWED_POST_DISPLAYS = ['show', 'dim', 'hide'].freeze
|
||||
VIEWED_POST_DISPLAYS = ['show', 'dim'].freeze
|
||||
AUTO_FETCH_MODES = ['auto', 'manual', 'off'].freeze
|
||||
WIKI_EDITOR_MODES = ['split', 'write', 'preview'].freeze
|
||||
|
||||
|
||||
新しい課題から参照
ユーザをブロックする