Displaying 2 results from an estimated 2 matches for "invoice_number".
2008 Jun 14
0
does BackgrounDRB not "know" the rails environment it is running within/in parallel with?]
...#39;: uninitialized
constant Invoice::ApplicationController
Situation:
I have an InvoicesController with a create method that in turn calls
upon a MiddleMan.worker(:billing_worker), which in turn finds an Invoice
and calls upon @invoice.print_invoice
"public/forms/invoices/html/#{invoice.invoice_number}.html" to generate
a html version of an invoice.
The class Invoice.rb has this print_invoice method:
def print_invoice path_and_file
htmlstring = self.render_to_string "invoices/show", :layout => false
File.open(path_and_file, "w+") do |f|
f.puts( htmlstr...
2006 May 31
1
find by sql
...d.
However this just doesnt seem right for rails, as ive managed to develop
the whole project without using any other pure sql.
Is there a cleaner way of doing this, but gaining the same results.
thanks
scott
#sql to find all invoices
pSql = "SELECT DISTINCT invoices.id, invoices.invoice_number,
invoices.approve_date, invoices.sent_date, invoices.paid_date
FROM projects, payments, invoices
WHERE projects.id = payments.project_id
AND payments.invoice_id = invoices.id
AND projects.id = " + params[:id] + "
ORDER BY invoic...