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 CHANGED
@@ -1 +1 @@
1
- 0.3.39
1
+ 0.3.40
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.3.39"
8
+ s.version = "0.3.40"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Patrick Lardin, Daniel Sudol"]
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fossil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.39
4
+ version: 0.3.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Lardin, Daniel Sudol