app/models/dorsale/billing_machine/quotation.rb in dorsale-3.3.0 vs app/models/dorsale/billing_machine/quotation.rb in dorsale-3.4.0
- old
+ new
@@ -18,10 +18,12 @@
accepts_nested_attributes_for :lines, allow_destroy: true
polymorphic_id_for :customer
+ mount_uploader :pdf_file, ::Dorsale::PdfUploader
+
validates :id_card, presence: true
validates :date, presence: true
validates :state, presence: true, inclusion: {in: proc { STATES } }
default_scope -> {
@@ -115,11 +117,9 @@
lines.each do |line|
line.vat_rate = vat_rate
end
end
- def to_pdf
- ::Dorsale::BillingMachine.quotation_pdf_model.new(self)
- .tap(&:build)
- .render_with_attachments
+ def after_attachments_changes
+ Dorsale::BillingMachine::PdfFileGenerator.(self)
end
end