fossil 0.3.39 → 0.3.40
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 +1 -1
- data/fossil.gemspec +1 -1
- data/lib/models/trip_leg.rb +1 -0
- data/spec/models/trip_leg_spec.rb +5 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.40
|
data/fossil.gemspec
CHANGED
data/lib/models/trip_leg.rb
CHANGED
@@ -758,6 +758,7 @@ class TripLeg < Sequel::Model(:'trip legs')
|
|
758
758
|
# converts nautical miles to statute miles with fractional bit
|
759
759
|
# silly because its so similar in value to statute_miles
|
760
760
|
def custom_statute_miles
|
761
|
+
return 0 unless nautical_miles
|
761
762
|
((nautical_miles*1.150777*10).to_i)/10.0
|
762
763
|
end
|
763
764
|
end
|
@@ -56,6 +56,11 @@ describe TripLeg do
|
|
56
56
|
tl.custom_statute_miles.should == 327.9
|
57
57
|
end
|
58
58
|
|
59
|
+
it "should properly handle nautical miles to statute miles when nautical_miles is nil" do
|
60
|
+
tl = TripLeg.new(:nautical_miles => nil)
|
61
|
+
tl.custom_statute_miles.should == 0
|
62
|
+
end
|
63
|
+
|
59
64
|
describe "should find correct passenger list" do
|
60
65
|
before :each do
|
61
66
|
@p1 = TripPassenger.new(:name=>"dan", :departure_leg_number=>0, :arrival_leg_number=>0, :lead_pax=>0)
|