class Delivery < ActiveRecord::Base
  
  include AmeeCarbonStore
  has_carbon_data_stored_in_amee :type_amount_repeats => true
  
  # Assumptions on types:
  #   - van - diesel, 1.305-1.740 tonnes
  #   - non-articulated lorry - diesel, fixed load
  #   - articulated lorry - diesel, fixed load
  COLOUR = "#FFBA4E"
  TRAIN_MASS = 1
  TYPE = {
    :van => AmeeCategory.new("Van", :distance, "/transport/van/generic/defra", :fuel => "diesel", :size => "1.305 to 1.740 tonnes"),
    :non_articulated => AmeeCategory.new("Non-Articulated Lorry", :distance, "/transport/lgv/generic/defra", :type => "rigid", :size => "uk average"),
    :articulated => AmeeCategory.new("Articulated Lorry", :distance, "/transport/lgv/generic/defra", :type => "articulated", :size => "uk average")
  }
  
  def amee_category
    TYPE[delivery_type.to_sym]
  end
  
  def additional_options
    delivery_type.to_sym == :rail ? {:mass => TRAIN_MASS} : nil
  end
end
class Delivery < ActiveRecord::Base
  
  include AmeeCarbonStore
  has_carbon_data_stored_in_amee :type_amount_repeats => true
  
  # Assumptions on types:
  #   - van - diesel, 1.305-1.740 tonnes
  #   - non-articulated lorry - diesel, fixed load
  #   - articulated lorry - diesel, fixed load
  COLOUR = "#FFBA4E"
  TYPE = {
    :van => AmeeCategory.new("Van", :distance, "/transport/van/generic/defra", :fuel => "diesel", :size => "1.305 to 1.740 tonnes"),
    :non_articulated => AmeeCategory.new("Non-Articulated Lorry", :distance, "/transport/lgv/generic/defra", :type => "rigid", :size => "uk average"),
    :articulated => AmeeCategory.new("Articulated Lorry", :distance, "/transport/lgv/generic/defra", :type => "articulated", :size => "uk average")
  }
  
  def amee_category
    TYPE[delivery_type.to_sym]
  end
end
Remove code associated with trains
Remove code associated with trains

git-svn-id: 580bd9fa1c05b46825c6f0daa1e3fea71c2c7222@5484 b293a2d2-da53-4cb3-b1bf-c591e3edcd7a
