Last active
August 8, 2018 22:10
-
-
Save joegaudet/5275d9723149cfbfa667bf5a884d0146 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Invocing | |
module Queries | |
class FindClientInvoiceByOrder | |
dependency :client_invoice_dao, ClientInvoice | |
def call(order_id) | |
ClientInvoice.includes(:line_items).find_by(order_id: order_id) | |
end | |
def self.call(order) | |
new.(order.id) | |
end | |
end | |
end | |
end |
This file contains hidden or 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
client_invoice = Invoicing::Queries::FindClientInvoiceByOrder.(order) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment