Skip to content

Commit

Permalink
Reduced nested conditional to compound expression
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt authored and radar committed Aug 15, 2013
1 parent 4e22252 commit 04b8fd3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/app/controllers/spree/admin/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ def authorize_admin
# Need to generate an API key for a user due to some backend actions
# requiring authentication to the Spree API
def generate_admin_api_key
if user = try_spree_current_user
if user.spree_api_key.blank?
user.generate_spree_api_key!
end
if (user = try_spree_current_user) && user.spree_api_key.blank?
user.generate_spree_api_key!
end
end

Expand Down

0 comments on commit 04b8fd3

Please sign in to comment.