X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/377f394a7cf968f1937030687fe71a393dea6244..ef85e8c7b346588a5e6ad0df7ddeb1046977c61a:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index cca894a6b..023604801 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -87,7 +87,7 @@ class User < ApplicationRecord scope :active, -> { where(:status => %w[active confirmed]) } scope :identifiable, -> { where(:data_public => true) } - has_one_attached :avatar + has_one_attached :avatar, :service => Settings.avatar_storage validates :display_name, :presence => true, :length => 3..255, :exclusion => %w[new terms save confirm confirm-email go_public reset-password forgot-password suspended] @@ -118,7 +118,6 @@ class User < ApplicationRecord before_save :encrypt_password before_save :update_tile after_save :spam_check - after_save :reset_preferred_languages def to_param display_name @@ -179,10 +178,6 @@ class User < ApplicationRecord @preferred_languages ||= Locale.list(languages) end - def reset_preferred_languages - @preferred_languages = nil - end - def nearby(radius = Settings.nearby_radius, num = Settings.nearby_users) if home_lon && home_lat gc = OSM::GreatCircle.new(home_lat, home_lon)