move website from User to UserProfile

This commit is contained in:
Andrew Bezzub
2014-06-06 21:54:32 -07:00
parent 1c7f68764a
commit 7db31adf35
6 changed files with 29 additions and 5 deletions
+2 -2
View File
@@ -28,7 +28,8 @@ class UserUpdater
end
def update(attributes = {})
user.website = format_url(attributes.fetch(:website) { user.website })
user_profile = user.user_profile
user_profile.website = format_url(attributes.fetch(:website) { user_profile.website })
user.bio_raw = attributes.fetch(:bio_raw) { user.bio_raw }
user.name = attributes.fetch(:name) { user.name }
@@ -59,7 +60,6 @@ class UserUpdater
end
end
user_profile = user.user_profile
PROFILE_ATTR.each do |attribute|
user_profile.send("#{attribute.to_s}=", attributes[attribute])
end