fossil 0.5.37 → 0.5.38

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.37
1
+ 0.5.38
data/fossil.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fossil}
8
- s.version = "0.5.37"
8
+ s.version = "0.5.38"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Sudol", "Patrick Lardin"]
@@ -1,3 +1,22 @@
1
1
  class FlightLogExpense
2
+
2
3
  many_to_one :trip_leg, :class=>:TripLeg, :key=>:trip_leg_id
4
+
5
+ def airport_fuel_lookup
6
+ if is_departure_expense?
7
+ date1, date2 = trip_leg.dept_date_act_local, trip_leg.depart_date_local
8
+ fbo_id = trip_leg.fueler_id
9
+ else
10
+ date1, date2 = trip_leg.arr_date_act_local, trip_leg.arrival_date_local
11
+ fbo_id = trip_leg.fbo_id
12
+ end
13
+
14
+ # I would prefer to this filter{ (effective_date <= date1) | (effective_date <= date2) }
15
+ # for filter, but does not work if date is nil
16
+ ap = AirportFuel.
17
+ filter('`effective date` <= ? or `effective date` <= ?', date1, date2).
18
+ filter(:vendor_id=>vendor_id).filter(:fbo_id=> fbo_id).order(:effective_date).
19
+ last
20
+ ap ? ap.values : {}
21
+ end
3
22
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 37
9
- version: 0.5.37
8
+ - 38
9
+ version: 0.5.38
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Sudol