Sha256: 5b34c87bc02d7d653bb89691087db962aacfb10caae92621b6d3cd104144c6bb
Contents?: true
Size: 768 Bytes
Versions: 10
Compression:
Stored size: 768 Bytes
Contents
class Dorsale::BillingMachine::Quotation::Copy < ::Dorsale::Service attr_accessor :quotation, :copy def initialize(quotation) super() @quotation = quotation end def call @copy = quotation.dup @quotation.lines.each do |line| @copy.lines << line.dup end @copy.unique_index = nil @copy.created_at = nil @copy.updated_at = nil @copy.date = Date.current @copy.state = ::Dorsale::BillingMachine::Quotation::STATES.first @copy.save! @quotation.attachments.each do |attachment| new_attachment = attachment.dup new_attachment.attachable = @copy new_attachment.file = File.open(attachment.file.path) new_attachment.save! end @copy end end
Version data entries
10 entries across 10 versions & 1 rubygems