marty 1.0.31 → 1.0.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e4f006a835f8578a807cc2b0fb600e5959d2f73
4
- data.tar.gz: f6c613707a26a48c1b5b3bf45db78b0be8de1695
3
+ metadata.gz: 671ef9c9aeda422910eead24aa88e4c086f27661
4
+ data.tar.gz: 27c540837c2e1ca61c82f13491cbf42a737d3d91
5
5
  SHA512:
6
- metadata.gz: 64f56eaa96b97d59f8e11f7aa1441178480a54504ae0c05b1b29919d79bf06e9fe4635de326bc874d5035e9ff0ce8b6eaee588431a7d5e4abf27f452ee2baad1
7
- data.tar.gz: b86106c9cd903354fc0088429a9670fb82cd7245808f43b50f7c2110ad5b64e1a2a0db200cd2f5f1f142632859417df27fd4fc857ec0d6d80cd94f4e90132eb9
6
+ metadata.gz: 4231463e4c8d857aab0f957d6d2cce95070a52c6ab0454b7f96fee8d4a27c5f2ab6cc9cc9bd002768c5a8c189b741752cd25dc5c982657d0b1963ef0c173f760
7
+ data.tar.gz: 3a9d6e936a78ce5dd43e8e5aa69f543b46327110dfb29e71fd97f38acd75780f4b49f85c484e3e8f8269f3cf01349212c21b31f40792923d6b9aa67aa61100d8
@@ -74,6 +74,20 @@ module Layout
74
74
  )
75
75
  end
76
76
 
77
+ def enum_array(c, klass)
78
+ editor_config = {
79
+ multi_select: true,
80
+ store: klass::VALUES.to_a.sort,
81
+ type: :string,
82
+ xtype: :combo,
83
+ }
84
+ c.merge!(
85
+ type: :string,
86
+ column_config: { editor: editor_config },
87
+ field_config: editor_config,
88
+ )
89
+ end
90
+
77
91
  def enum_setter(name)
78
92
  lambda {|r, v| r.send("#{name}=", v.nil? || v.empty? || v == '---' ?
79
93
  nil : v)}
@@ -46,6 +46,8 @@ class Marty::DataConversion
46
46
  end
47
47
  when :string, :text, :enum
48
48
  v
49
+ when :enum_array
50
+ "'{#{v}}'"
49
51
  when :integer
50
52
  v.to_i
51
53
  when :float
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.0.31"
2
+ VERSION = "1.0.32"
3
3
  end
@@ -0,0 +1,6 @@
1
+ class AddStateArrayToLp < ActiveRecord::Migration
2
+ def change
3
+ add_column :gemini_loan_programs, :state_array, :enum_states,
4
+ array: true, null: true
5
+ end
6
+ end
@@ -53,11 +53,16 @@ Conv Fixed 30 2.250 1.123 2.345 12 2012
53
53
  EOF
54
54
 
55
55
  loan_programs =<<EOF
56
- name amortization_type mortgage_type streamline_type high_balance_indicator
57
- Conv Fixed 30 Year Fixed Conventional Not Streamlined false
58
- Conv Fixed 30 Year HB Fixed Conventional Not Streamlined true
59
- Conv Fixed 30 Year DURP <=80 Fixed Conventional DURP false
60
- Conv Fixed 30 Year DURP <=80 HB Fixed Conventional DURP true
56
+ name amortization_type mortgage_type streamline_type high_balance_indicator state_array
57
+ Conv Fixed 30 Year Fixed Conventional Not Streamlined false
58
+ Conv Fixed 30 Year HB Fixed Conventional Not Streamlined true TN
59
+ Conv Fixed 30 Year DURP <=80 Fixed Conventional DURP false TN,CT
60
+ Conv Fixed 30 Year DURP <=80 HB Fixed Conventional DURP true "CA,NY"
61
+ EOF
62
+
63
+ loan_programs_comma =<<EOF
64
+ name,amortization_type,mortgage_type,state_array,streamline_type,high_balance_indicator
65
+ FHA Fixed 15 Year,Fixed,FHA,"FL,NV,ME",Not Streamlined,false
61
66
  EOF
62
67
 
63
68
  fannie_bup4 =<<EOF
@@ -342,6 +347,20 @@ EOF
342
347
  end
343
348
  end
344
349
 
350
+ it "should load enum array types" do
351
+ Marty::DataImporter.do_import(Gemini::LoanProgram, loan_programs)
352
+ Marty::DataImporter.do_import(Gemini::LoanProgram, loan_programs_comma,
353
+ 'infinity', nil, nil, ',')
354
+ lpset = Gemini::LoanProgram.all.pluck(:name, :state_array).to_set
355
+ expect(lpset).to eq([["Conv Fixed 30 Year", nil],
356
+ ["Conv Fixed 30 Year HB", ["TN"]],
357
+ ["Conv Fixed 30 Year DURP <=80", ["TN", "CT"]],
358
+ ["Conv Fixed 30 Year DURP <=80 HB", ["CA","NY"]],
359
+ ["FHA Fixed 15 Year", ["FL","NV","ME"]]
360
+ ].to_set)
361
+
362
+ end
363
+
345
364
  it "should properly handle cases where an association item is missing" do
346
365
  res = Marty::DataImporter.do_import_summary(Gemini::BudCategory, bud_cats)
347
366
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.31
4
+ version: 1.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-06-26 00:00:00.000000000 Z
17
+ date: 2017-07-10 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg
@@ -570,6 +570,7 @@ files:
570
570
  - spec/dummy/db/migrate/20151023000001_create_simple.rb
571
571
  - spec/dummy/db/migrate/20160100000038_create_gemini_states.rb
572
572
  - spec/dummy/db/migrate/20160923183516_add_bulk_pricing_event_ops.rb
573
+ - spec/dummy/db/migrate/20170706081300_add_state_array_to_lp.rb
573
574
  - spec/dummy/db/seeds.rb
574
575
  - spec/dummy/delorean/blame_report.dl
575
576
  - spec/dummy/delorean/data_report.dl