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'
|
many :aspects, :class_name => 'Aspect'
|
||||||
|
|
||||||
|
|
||||||
after_create :setup_person
|
before_create :setup_person
|
||||||
|
after_create :set_diaspora_handle
|
||||||
|
|
||||||
before_validation :do_bad_things
|
before_validation :do_bad_things
|
||||||
before_save :downcase_username
|
before_save :downcase_username
|
||||||
|
|
@ -313,10 +314,13 @@ class User
|
||||||
|
|
||||||
def setup_person
|
def setup_person
|
||||||
self.person.serialized_key ||= User.generate_key.export
|
self.person.serialized_key ||= User.generate_key.export
|
||||||
self.person.diaspora_handle ||= self.diaspora_handle
|
|
||||||
self.person.save!
|
self.person.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_diaspora_handle
|
||||||
|
self.person.diaspora_handle ||= self.diaspora_handle
|
||||||
|
end
|
||||||
|
|
||||||
def downcase_username
|
def downcase_username
|
||||||
username.downcase!
|
username.downcase!
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue