-
-
Save rubysolo/308182 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return if user.bids.empty? | |
@bids_and_items = user.bids.inject({}) do |hsh, bid| | |
items_for_bid = hsh[bid] || [] | |
items_for_bid += line_items.select{|li| li.product.bids.include?(bid) } | |
hsh = hsh.update(bid => items_for_bid) unless items_for_bid.empty? | |
hsh | |
end | |
# send an email with items from each bid.. | |
SalesOrderMailer.deliver_bid_item_purchase_notification(@bids_and_items, self) unless @bids_and_items.empty? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment