MS made it two callbacks for handles and keys
This commit is contained in:
parent
16625f4ee9
commit
3a4eb294f8
2 changed files with 7 additions and 3 deletions
|
|
@ -35,7 +35,8 @@ class User
|
|||
many :aspects, :class_name => 'Aspect'
|
||||
|
||||
|
||||
after_create :setup_person
|
||||
before_create :setup_person
|
||||
after_create :set_diaspora_handle
|
||||
|
||||
before_validation :do_bad_things
|
||||
before_save :downcase_username
|
||||
|
|
@ -313,10 +314,13 @@ class User
|
|||
|
||||
def setup_person
|
||||
self.person.serialized_key ||= User.generate_key.export
|
||||
self.person.diaspora_handle ||= self.diaspora_handle
|
||||
self.person.save!
|
||||
end
|
||||
|
||||
def set_diaspora_handle
|
||||
self.person.diaspora_handle ||= self.diaspora_handle
|
||||
end
|
||||
|
||||
def downcase_username
|
||||
username.downcase!
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue