flight 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/flight/carbon_model.rb +5 -5
  2. metadata +3 -3
@@ -76,7 +76,7 @@ module BrighterPlanet
76
76
  if flight_segment_aircraft.values.map(&:m3).any?
77
77
  m3 = flight_segments.inject(0) do |m3, flight_segment|
78
78
  aircraft = flight_segment_aircraft[flight_segment.row_hash]
79
- aircraft_m3 = aircraft.m3 || 0
79
+ aircraft_m3 = aircraft.andand.m3 || 0
80
80
  m3 + (aircraft_m3 * flight_segment.passengers)
81
81
  end
82
82
  else
@@ -85,8 +85,8 @@ module BrighterPlanet
85
85
 
86
86
  if flight_segment_aircraft.values.map(&:m2).any?
87
87
  m2 = flight_segments.inject(0) do |m2, flight_segment|
88
- aircraft = Aircraft.find_by_bts_aircraft_type_code flight_segment.bts_aircraft_type_code
89
- aircraft_m2 = aircraft.m2 || 0
88
+ aircraft = flight_segment_aircraft[flight_segment.row_hash]
89
+ aircraft_m2 = aircraft.andand.m2 || 0
90
90
  m2 + (aircraft_m2 * flight_segment.passengers)
91
91
  end
92
92
  else
@@ -95,8 +95,8 @@ module BrighterPlanet
95
95
 
96
96
  if flight_segment_aircraft.values.map(&:m1).any?
97
97
  m1 = flight_segments.inject(0) do |m1, flight_segment|
98
- aircraft = Aircraft.find_by_bts_aircraft_type_code flight_segment.bts_aircraft_type_code
99
- aircraft_m1 = aircraft.m1 || 0
98
+ aircraft = flight_segment_aircraft[flight_segment.row_hash]
99
+ aircraft_m1 = aircraft.andand.m1 || 0
100
100
  m1 + (aircraft_m1 * flight_segment.passengers)
101
101
  end
102
102
  else
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flight
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 20
10
- version: 0.0.20
9
+ - 21
10
+ version: 0.0.21
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Rossmeissl