Sha256: 5d931f81c4c6026ab8d32120804a06a335e7530251698ec442aea1fbfe5574a7

Contents?: true

Size: 564 Bytes

Versions: 7

Compression:

Stored size: 564 Bytes

Contents

require 'earth/model'

require 'earth/shipping/carrier_mode'

class ShipmentMode < ActiveRecord::Base
  extend Earth::Model

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE shipment_modes
  (
     name                            CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     route_inefficiency_factor       FLOAT,
     transport_emission_factor       FLOAT,
     transport_emission_factor_units CHARACTER VARYING(255)
  );

EOS

  self.primary_key = "name"
  
  has_many :carrier_modes, :foreign_key => 'mode_name', :primary_key => 'name'
  
  warn_unless_size 3
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/shipping/shipment_mode.rb
earth-1.1.2 lib/earth/shipping/shipment_mode.rb
earth-1.1.1 lib/earth/shipping/shipment_mode.rb
earth-1.1.0 lib/earth/shipping/shipment_mode.rb
earth-1.0.3 lib/earth/shipping/shipment_mode.rb
earth-1.0.2 lib/earth/shipping/shipment_mode.rb
earth-1.0.1 lib/earth/shipping/shipment_mode.rb