Skip to content

Commit

Permalink
Replace unless with conditional assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
sauloperez committed Mar 2, 2020
1 parent 9647317 commit d81cbd4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/open_food_network/orders_and_fulfillments_report.rb
Expand Up @@ -82,8 +82,7 @@ def scale_factor(product)
end

def order_permissions
return @order_permissions unless @order_permissions.nil?
@order_permissions = ::Permissions::Order.new(@user)
@order_permissions ||= ::Permissions::Order.new(@user)
end

def report_line_items
Expand Down

0 comments on commit d81cbd4

Please sign in to comment.