Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 788fe6aba..4cfd9eb4b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -250,7 +250,7 @@ class User < ApplicationRecord
def update_post(post, post_hash={})
if self.owns? post
- post.update_attributes(post_hash)
+ post.update(post_hash)
self.dispatch_post(post)
end
end
@@ -375,7 +375,7 @@ class User < ApplicationRecord
########### Profile ######################
def update_profile(params)
if photo = params.delete(:photo)
- photo.update_attributes(:pending => false) if photo.pending
+ photo.update(pending: false) if photo.pending
params[:image_url] = photo.url(:thumb_large)
params[:image_url_medium] = photo.url(:thumb_medium)
params[:image_url_small] = photo.url(:thumb_small)
@@ -383,7 +383,7 @@ class User < ApplicationRecord
params.stringify_keys!
params.slice!(*(Profile.column_names+['tag_string', 'date']))
- if self.profile.update_attributes(params)
+ if profile.update(params)
deliver_profile_update
true
else
@@ -535,10 +535,10 @@ class User < ApplicationRecord
end
def no_person_with_same_username
- diaspora_id = "#{self.username}#{User.diaspora_id_host}"
- if self.username_changed? && Person.exists?(:diaspora_handle => diaspora_id)
- errors[:base] << 'That username has already been taken'
- end
+ diaspora_id = "#{username}#{User.diaspora_id_host}"
+ return unless username_changed? && Person.exists?(diaspora_handle: diaspora_id)
+
+ errors.add(:base, "That username has already been taken")
end
def close_account!