FIX: editing user title was deleting location

This commit is contained in:
Arpit Jalan 2016-05-03 22:19:30 +05:30
parent ad15049ef0
commit 26964a72ca

View file

@ -34,7 +34,7 @@ class UserUpdater
def update(attributes = {})
user_profile = user.user_profile
user_profile.location = attributes[:location]
user_profile.location = attributes.fetch(:location) { user_profile.location }
user_profile.dismissed_banner_key = attributes[:dismissed_banner_key] if attributes[:dismissed_banner_key].present?
user_profile.website = format_url(attributes.fetch(:website) { user_profile.website })
user_profile.bio_raw = attributes.fetch(:bio_raw) { user_profile.bio_raw }