nyastodon/app/services/setup_local_account_service.rb

15 lines
358 B
Ruby
Raw Normal View History

2016-02-24 12:57:29 +01:00
class SetupLocalAccountService < BaseService
# Setup an account for a new user instance by generating
# an RSA key pair and a profile
# @param [User] user Unsaved user instance
# @param [String] username
2016-02-22 16:00:20 +01:00
def call(user, username)
user.build_account
user.account.username = username
user.account.domain = nil
user.save!
end
end