Skip to content

Commit

Permalink
Fix Style/GuardClause
Browse files Browse the repository at this point in the history
  • Loading branch information
Koronen committed Jan 24, 2016
1 parent fb49453 commit 136dcc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'fever_api.rb'

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
Expand Down
7 changes: 3 additions & 4 deletions fever_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ class Endpoint < Sinatra::Base
end

def authenticated?(api_key)
if api_key
user = User.first
user.api_key && api_key.downcase == user.api_key.downcase
end
return unless api_key
user = User.first
user.api_key && api_key.downcase == user.api_key.downcase
end

get "/" do
Expand Down

0 comments on commit 136dcc4

Please sign in to comment.