Sha256: 2004fd049fce5d734c7c85e8d6c3d6320196935075078b1362035e45336ff681

Contents?: true

Size: 575 Bytes

Versions: 11

Compression:

Stored size: 575 Bytes

Contents

class ServiceTrack::NuevaRotura

  def initialize(opts)
    opts.each_pair { |k, v| instance_variable_set("@#{k}", v) }

    @cantidad = 1 # de momento ?
  end

  def save
    ActiveRecord::Base.transaction do
      create_roturas
    end
  end

  def create_roturas
    @elementos_y_prd_tracks.each do |eypt|
      RoturaVidrio.create(item_medida_id: @item_medida.id, elemento_id: eypt[:elemento].id, observacion: @motivo_rotura, motivo_id: @motivo_id, momento_id: @momento_id, puesto_control_id: @puesto_rotura_vidrio.id, user_id: @current_user.try(:id))
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spf_tracking-0.0.28 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.27 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.26 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.25 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.24 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.23 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.22 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.19 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.18 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.17 lib/service_track/nueva_rotura.rb
spf_tracking-0.0.16 lib/service_track/nueva_rotura.rb