@@ 179,7 179,11 @@ class UnknownTransactions
LEFT JOIN transactions USING (transaction_id)
WHERE transactions.transaction_id IS NULL
SQL
- new(customer_id, rows.map { |row| row["transaction_id"] })
+ self.for(customer_id, rows.map { |row| row["transaction_id"] })
+ end
+
+ def self.for(customer_id, transaction_ids)
+ transaction_ids.empty? ? None.new : new(customer_id, transaction_ids)
end
def initialize(customer_id, transaction_ids)
@@ 193,6 197,10 @@ class UnknownTransactions
*@transaction_ids.flat_map { |txid| [txid, @customer_id] }
)
end
+
+ class None
+ def enqueue!; end
+ end
end
class JmpPay < Roda