Remove code complexity around resetting language preferences

This was originally introduced since we saved the user and showed
the result on the same action. Now that the preferences controller
saves and redirects, the user model and associated language preferences
are reloaded between requests, and this code is no longer required.
This commit is contained in:
Andy Allan 2021-07-14 12:43:54 +01:00
parent 2403630da8
commit 9b8f2bbcbe
2 changed files with 3 additions and 9 deletions

View file

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