class CreateAdminService
  def call
    user = User.find_or_create_by!(email: Rails.application.secrets.admin_email) do |user|
      user.password = Rails.application.secrets.admin_password
      user.password_confirmation = Rails.application.secrets.admin_password
      user.soft_token = Rails.application.secrets.admin_soft_token
      user.confirm
      user.admin!
    end
  end
end
