fossil 0.3.16 → 0.3.17

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.16
1
+ 0.3.17
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.16"
8
+ s.version = "0.3.17"
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"]
@@ -1,7 +1,7 @@
1
1
  class VendorDocument < Sequel::Model(:'vendor documents')
2
2
  # helper accessors for creating vendor document
3
3
  # filename_prefix helps set up the path to the document
4
- attr_accessor :doc_type_value, :doc_filename_prefix, :doc_type, :doc_filename
4
+ attr_accessor :doc_type_value, :file_name_prefix, :doc_type, :file_name
5
5
 
6
6
  ###### helper aliases for crewres to submit new vendor documents #########
7
7
  column_alias :trip_number, :number, :type => :integer
@@ -14,7 +14,7 @@ class VendorDocument < Sequel::Model(:'vendor documents')
14
14
  code_association :type, :document_type, :aircraft_document
15
15
 
16
16
  def validate
17
- validates_presence [:doc_filename_prefix, :file_name, :trip_number, :doc_date, :document_type]
17
+ validates_presence [:document_type, :image_name, :number, :doc_date, :document_type]
18
18
  end
19
19
 
20
20
  def after_initialize
@@ -54,7 +54,7 @@ class VendorDocument < Sequel::Model(:'vendor documents')
54
54
  self.paid_date= 0
55
55
  self.paid= 0
56
56
  self.billed_date= 0
57
- self.image_name= File.join(doc_filename_prefix, doc_filename) if doc_filename
57
+ self.image_name= File.join(file_name_prefix, file_name) if file_name
58
58
  self.document_type= doc_type_value if Code.valid_value_for_group?(doc_type_value, :aircraft_document)
59
59
  end
60
60
 
@@ -8,15 +8,13 @@ describe "Trip" do
8
8
 
9
9
  it "creates a vendor document attachment" do
10
10
  trip = Trip.new(:kid_date=>1,:kid_time=>2,:kid_user=>3,:kid_mult=>4,:kid_comm=>5)
11
- arr = []
12
- mock(VendorDocument).get_all_types {arr}
13
- mock(arr).find {OpenStruct.new(:value=>"fake_doc_type")}
14
- doc = VendorDocument.new(:doc_filename_prefix=>"TRIP", :doc_filename=>"whatever", :doc_type_value=> 254, :trip_number=>111)
11
+ mock(Code).valid_value_for_group?(254, :aircraft_document) {true}
12
+ doc = VendorDocument.new(:file_name_prefix=>"TRIP", :file_name=>"whatever", :doc_type_value=> 254, :trip_number=>111)
15
13
  doc.save()
16
14
  trip.add_attachment(doc)
17
15
  doc.kid_user.should == "ADMN"
18
16
  doc.image_name.should == "TRIP/whatever"
19
- doc.document_type.should == "fake_doc_type"
17
+ doc.document_type.should == 254
20
18
  end
21
19
 
22
20
  end
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.16
4
+ version: 0.3.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Lardin, Daniel Sudol