go_import 3.0.15 → 3.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/go_import/model/deal.rb +2 -0
- data/lib/go_import/model/file.rb +1 -1
- data/lib/go_import/model/organization.rb +1 -0
- data/lib/go_import/model/person.rb +2 -0
- data/lib/go_import/model_helpers.rb +2 -0
- data/sources/VISMA/.go_import/runner.rb +0 -1
- data/sources/csv/.go_import/runner.rb +0 -1
- data/sources/easy/.go_import/runner.rb +0 -1
- data/sources/excel/.go_import/runner.rb +0 -1
- data/sources/excel/converter.rb +4 -1
- data/spec/deal_spec.rb +6 -0
- data/spec/file_spec.rb +1 -1
- data/spec/helpers/serialize_helper_spec.rb +0 -1
- data/spec/organization_spec.rb +8 -0
- data/spec/person_spec.rb +12 -3
- metadata +8 -2
data/lib/go_import/model/deal.rb
CHANGED
data/lib/go_import/model/file.rb
CHANGED
@@ -36,7 +36,6 @@ def convert_source
|
|
36
36
|
if defined?(ORGANIZATION_FILE) && !ORGANIZATION_FILE.nil? && !ORGANIZATION_FILE.empty?
|
37
37
|
process_rows ORGANIZATION_FILE do |row|
|
38
38
|
organization = converter.to_organization(row, rootmodel)
|
39
|
-
organization.set_tag "Import"
|
40
39
|
rootmodel.add_organization(organization)
|
41
40
|
end
|
42
41
|
end
|
@@ -106,7 +106,6 @@ end
|
|
106
106
|
|
107
107
|
def init_organization(row, rootmodel)
|
108
108
|
organization = GoImport::Organization.new
|
109
|
-
organization.set_tag "Import"
|
110
109
|
# integration_id is typically the company Id in Easy
|
111
110
|
# Must be set to be able to import the same file more
|
112
111
|
# than once without creating duplicates
|
data/sources/excel/converter.rb
CHANGED
@@ -49,7 +49,7 @@ class Converter
|
|
49
49
|
# used as default.
|
50
50
|
|
51
51
|
# rootmodel.settings.with_organization do |organization|
|
52
|
-
# organization.set_custom_field( { :
|
52
|
+
# organization.set_custom_field( { :integration_id => 'source', :title => 'Källa', :type => :Link } )
|
53
53
|
# end
|
54
54
|
end
|
55
55
|
|
@@ -106,6 +106,9 @@ class Converter
|
|
106
106
|
|
107
107
|
organization.name = row['Namn']
|
108
108
|
|
109
|
+
# Set responsible such as
|
110
|
+
# organization.responsible_coworker = rootmodel.find_coworker_by_integration_id(row['Medarbetare'])
|
111
|
+
|
109
112
|
# Custom fields should be set like this.
|
110
113
|
# organization.set_custom_value("source", "internet")
|
111
114
|
|
data/spec/deal_spec.rb
CHANGED
@@ -6,6 +6,12 @@ describe "Deal" do
|
|
6
6
|
GoImport::Deal.new
|
7
7
|
}
|
8
8
|
|
9
|
+
it "should have import tag as default" do
|
10
|
+
# given, when, then
|
11
|
+
deal.tags.count.should eq 1
|
12
|
+
deal.tags[0].value.should eq 'Import'
|
13
|
+
end
|
14
|
+
|
9
15
|
it "will set customer ref when customer is assigned" do
|
10
16
|
# given
|
11
17
|
org = GoImport::Organization.new({:integration_id => "123", :name => "Lundalogik"})
|
data/spec/file_spec.rb
CHANGED
@@ -54,7 +54,6 @@ describe GoImport::SerializeHelper do
|
|
54
54
|
serialized.should_not match(/<Email>/)
|
55
55
|
serialized.should_not match(/<Position>/)
|
56
56
|
serialized.should_not match(/<AlternativeEmail>/)
|
57
|
-
serialized.should_not match(/<Tags>/)
|
58
57
|
serialized.should_not match(/<CustomValues>/)
|
59
58
|
end
|
60
59
|
it "should be utf-8" do
|
data/spec/organization_spec.rb
CHANGED
@@ -6,9 +6,17 @@ describe "Organization" do
|
|
6
6
|
GoImport::Organization.new
|
7
7
|
}
|
8
8
|
|
9
|
+
it "should have import tag as default" do
|
10
|
+
# given, when, then
|
11
|
+
organization.tags.count.should eq 1
|
12
|
+
organization.tags[0].value.should eq 'Import'
|
13
|
+
end
|
14
|
+
|
9
15
|
it "must have a name" do
|
16
|
+
# given, when
|
10
17
|
organization.name = "Lundalogik"
|
11
18
|
|
19
|
+
# then
|
12
20
|
organization.validate.should eq ""
|
13
21
|
end
|
14
22
|
|
data/spec/person_spec.rb
CHANGED
@@ -6,6 +6,12 @@ describe "Person" do
|
|
6
6
|
GoImport::Person.new
|
7
7
|
}
|
8
8
|
|
9
|
+
it "should have import tag as default" do
|
10
|
+
# given, when, then
|
11
|
+
person.tags.count.should eq 1
|
12
|
+
person.tags[0].value.should eq 'Import'
|
13
|
+
end
|
14
|
+
|
9
15
|
it "can set a customfield" do
|
10
16
|
person.set_custom_field({:integration_id=>'the key',
|
11
17
|
:value=> 'the value'})
|
@@ -55,11 +61,14 @@ describe "Person" do
|
|
55
61
|
end
|
56
62
|
|
57
63
|
it "will only set tag once" do
|
64
|
+
# we already have the default 'import' tag.
|
65
|
+
person.tags.length.should eq 1
|
66
|
+
|
58
67
|
person.set_tag('tag1')
|
59
68
|
person.set_tag('tag1')
|
60
|
-
|
61
|
-
|
62
|
-
|
69
|
+
|
70
|
+
person.tags.length.should eq 2
|
71
|
+
person.tags[1].value.should eq 'tag1'
|
63
72
|
end
|
64
73
|
|
65
74
|
it "should have a firstname if no lastname" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-10-
|
15
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: iso_country_codes
|
@@ -271,12 +271,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
271
271
|
- - ! '>='
|
272
272
|
- !ruby/object:Gem::Version
|
273
273
|
version: '0'
|
274
|
+
segments:
|
275
|
+
- 0
|
276
|
+
hash: 1057665117
|
274
277
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
275
278
|
none: false
|
276
279
|
requirements:
|
277
280
|
- - ! '>='
|
278
281
|
- !ruby/object:Gem::Version
|
279
282
|
version: '0'
|
283
|
+
segments:
|
284
|
+
- 0
|
285
|
+
hash: 1057665117
|
280
286
|
requirements: []
|
281
287
|
rubyforge_project:
|
282
288
|
rubygems_version: 1.8.24
|