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:
Thibaut Girka
2018-06-21 20:49:57 +02:00
129 changed files with 1169 additions and 576 deletions

View File

@@ -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!