fossil 0.3.4 → 0.3.5

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.4
1
+ 0.3.5
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.4"
8
+ s.version = "0.3.5"
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"]
@@ -8,6 +8,8 @@ class CrewLeg < Sequel::Model(:'crew legs')
8
8
  # Code associations
9
9
  code_association :position_code, :'position', :position
10
10
 
11
+ delegate :employee_name, :to => :crew_name
12
+
11
13
  #### BEGIN GENERATED SECTION ####
12
14
  set_primary_key [:'kid - user', :'kid - mult', :'kid - comm', :'kid - date', :'kid - time']
13
15
 
@@ -678,10 +678,16 @@ class TripLeg < Sequel::Model(:'trip legs')
678
678
 
679
679
  # get pic or sic or purser for this trip leg. type should be :pic or :sic or :pur
680
680
  def pilot_code(type)
681
- return '' unless type
682
- cl = crew_legs.find{|cl| cl.position_code_code == type.to_s.upcase }
683
- return cl ? cl.crew : ''
681
+ crew_leg = pilot_crew(type)
682
+ crew_leg ? crew_leg.crew : ''
684
683
  end
685
684
  def pic; pilot_code(:pic); end
686
685
  def sic; pilot_code(:sic); end
686
+
687
+ def pilot_crew(type)
688
+ return nil unless type
689
+ crew_legs.find{|cl| cl.position_code_code == type.to_s.upcase }
690
+ end
691
+ def pic_crew; pilot_crew(:pic); end
692
+ def sic_crew; pilot_crew(:sic); end
687
693
  end
@@ -18,7 +18,7 @@ class Sequel::Model
18
18
  # create delegator on the fly
19
19
  method_call = arr.shift
20
20
  arr.each do |next_call|
21
- unless respond_to? (method_call + "_" + next_call)
21
+ unless respond_to?(method_call + "_" + next_call)
22
22
  self.class.delegate next_call.to_sym, :to => method_call.to_sym, :prefix => true, :allow_nil => true
23
23
  end
24
24
  method_call = method_call + "_" + next_call
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.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Lardin, Daniel Sudol