earth 0.2.9 → 0.2.11
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.
|
@@ -185,7 +185,7 @@ Aircraft.class_eval do
|
|
|
185
185
|
# GROUP BY aircraft.icao_code
|
|
186
186
|
|
|
187
187
|
conditional_relation = segments[:aircraft_bts_code].eq(aircraft[:bts_code])
|
|
188
|
-
update_all "seats
|
|
188
|
+
update_all "seats = (#{FlightSegment.weighted_average_relation(:seats, :weighted_by => :passengers).where(conditional_relation).to_sql})"
|
|
189
189
|
update_all "weighting = (#{segments.project(segments[:passengers].sum).where(conditional_relation).to_sql})"
|
|
190
190
|
|
|
191
191
|
# conditional_relation = aircraft[:aircraft_type_code].eq(segments[:aircraft_type_code])
|
|
@@ -51,7 +51,7 @@ Airport.class_eval do
|
|
|
51
51
|
|
|
52
52
|
process "Determine whether each airport serves international flights" do
|
|
53
53
|
FlightSegment.run_data_miner!
|
|
54
|
-
|
|
54
|
+
update_all 'international_origin = 1','(SELECT COUNT(*) FROM flight_segments WHERE flight_segments.origin_airport_iata_code = airports.iata_code AND flight_segments.origin_country_iso_3166_code != flight_segments.destination_country_iso_3166_code AND flight_segments.origin_country_iso_3166_code IS NOT NULL AND flight_segments.destination_country_iso_3166_code IS NOT NULL LIMIT 1) > 0'
|
|
55
55
|
update_all 'international_destination = 1', '(SELECT COUNT(*) FROM flight_segments WHERE flight_segments.destination_airport_iata_code = airports.iata_code AND flight_segments.origin_country_iso_3166_code != flight_segments.destination_country_iso_3166_code AND flight_segments.origin_country_iso_3166_code IS NOT NULL AND flight_segments.destination_country_iso_3166_code IS NOT NULL LIMIT 1) > 0'
|
|
56
56
|
end
|
|
57
57
|
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 2
|
|
8
|
-
-
|
|
9
|
-
version: 0.2.
|
|
8
|
+
- 11
|
|
9
|
+
version: 0.2.11
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Seamus Abshere
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2010-11-
|
|
19
|
+
date: 2010-11-10 00:00:00 -05:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|