Class: NexusLink::Models::PedidoVenta

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/nexus_link/models/pedido_venta.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
# File 'lib/nexus_link/models/pedido_venta.rb', line 8

def create
  @nax_obj = NAX::PedidoVenta.create(self.attributes)
  self.lineas.each {|l| nax_save_line(l) }
  @nax_obj.save
  @nax_obj = nil
end

#nax_save_line(line) ⇒ Object



15
16
17
# File 'lib/nexus_link/models/pedido_venta.rb', line 15

def nax_save_line(line)
  @nax_obj.add_line(line.attributes)        
end