Skip to content

Commit

Permalink
Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
thegcat committed Jun 16, 2017
1 parent 03cb73a commit 19f559c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions app/interactors/warn_if_product_quantity_below_threshold.rb
Expand Up @@ -2,10 +2,9 @@ class WarnIfProductQuantityBelowThreshold
include Interactor

def call
btp = context.cart.cart_items.collect(&:product).
select { |p| p.below_warning_threshold? }.
compact.uniq
btp = context.cart.cart_items.map(&:product).
select(&:below_warning_threshold?).
compact.uniq
AdminMailer.btp_mail(btp: btp).deliver_later if btp.present?
end
end

1 change: 0 additions & 1 deletion app/mailers/application_mailer.rb
Expand Up @@ -2,4 +2,3 @@ class ApplicationMailer < ActionMailer::Base
default from: 'kdv@kif.rocks'
layout 'mailer'
end

2 changes: 1 addition & 1 deletion spec/interactors/pay_cart_spec.rb
Expand Up @@ -17,7 +17,7 @@
create(:product, price: 200, quantity: 5)
]
end
let(:pricings) { products.collect { |p| p.pricings.first } }
let(:pricings) { products.map { |p| p.pricings.first } }
let(:cart_items) do
[
create(:cart_item, quantity: 2, pricing: pricings[0]),
Expand Down

0 comments on commit 19f559c

Please sign in to comment.