Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #762 from fastlane/KrauseFx-patch-3
Browse files Browse the repository at this point in the history
Remove debug and TODO code in user_service, make parameters required
  • Loading branch information
KrauseFx committed Apr 26, 2018
2 parents 8600268 + 1521ea1 commit e23bff1
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions app/services/user_service.rb
Expand Up @@ -37,7 +37,7 @@ def users
user_data_source.users
end

def create_user!(id: nil, email: nil, password: nil)
def create_user!(id:, email:, password:)
email.strip!

unless user_data_source.user_exist?(email: email)
Expand All @@ -49,24 +49,16 @@ def create_user!(id: nil, email: nil, password: nil)
return nil
end

# TODO: THIS ALWAYS TURNS THE PROVIDER CREDENTIALS INTO HASHES
def update_user!(user: nil)
success = user_data_source.update_user!(user: user)
if success
# TODO: remove this message if https://github.com/fastlane/ci/issues/292 is fixed
# rubocop:disable Metrics/LineLength
logger.info("Updated user #{user.email}, that means you should call `find_user(id:)` see https://github.com/fastlane/ci/issues/292")
# rubocop:enable Metrics/LineLength
end
return success
def update_user!(user:)
return user_data_source.update_user!(user: user)
end

def delete_user!(user: nil)
def delete_user!(user:)
user_data_source.delete_user!(user: user)
end

# @return [User]
def find_user(id: nil)
def find_user(id:)
return user_data_source.find_user(id: id)
end

Expand Down

0 comments on commit e23bff1

Please sign in to comment.