Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: app/models/user.rb Resolved by adding :default_language to user settings fields
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
# moderator :boolean default(FALSE), not null
|
||||
# invite_id :bigint(8)
|
||||
# remember_token :string
|
||||
# chosen_languages :string is an Array
|
||||
#
|
||||
|
||||
class User < ApplicationRecord
|
||||
@@ -88,7 +89,7 @@ class User < ApplicationRecord
|
||||
|
||||
delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
|
||||
:reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_sensitive_media, :hide_network,
|
||||
to: :settings, prefix: :setting, allow_nil: false
|
||||
:default_language, to: :settings, prefix: :setting, allow_nil: false
|
||||
|
||||
attr_accessor :invite_code
|
||||
|
||||
@@ -317,7 +318,9 @@ class User < ApplicationRecord
|
||||
private
|
||||
|
||||
def sanitize_languages
|
||||
filtered_languages.reject!(&:blank?)
|
||||
return if chosen_languages.nil?
|
||||
chosen_languages.reject!(&:blank?)
|
||||
self.chosen_languages = nil if chosen_languages.empty?
|
||||
end
|
||||
|
||||
def prepare_new_user!
|
||||
|
Reference in New Issue
Block a user