Tag: move-method

Daily Refactor #81: Move last_invoice_number to Model

The Refactoring Today I used move method on the InvoiceController to move the #last_invoice_number to the Invoice model Before 1 2 3 4 5 6 7 8 class InvoiceController 'id DESC') unless last_invoice.nil? last_invoice.invoice_number else '-' end end endclass InvoiceController 'id DESC') unless last_invoice.nil? last_invoice.invoice_number else '-' end end end 1 2 3 class Invoice …

Read more