go_import 3.0.42 → 4.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c51550ffff27ad4fe7f57413acf77764bfd98c9c
4
- data.tar.gz: 7aed552fb4339fce5e9419ec9153d60d6add44aa
3
+ metadata.gz: b80d03092ece9f1cc8f8194de2e009fea1ec57f9
4
+ data.tar.gz: cb272c0880e52b47b935320a45d452c94e5f3df3
5
5
  SHA512:
6
- metadata.gz: 8d7028dc367f5d84904c731018c0d77d2951d7267649926e0066584ef0560f43fd797634a8c6f634d6c5de7e983d1dcb1bb3e4860d85040b077eb2de5e39cd35
7
- data.tar.gz: b3bb492a053c4dee863714424af4d763d1a0c6c2d907416b6f7190356c6550b70d4842b10e4ba82ece600254aa66865b12ac88207b44d38c5541067d6974f427
6
+ metadata.gz: 6b83c3c678daca732107052641e35d2c3bc2b393465b127d281d9513516d1b1135d82bfa6fe14b7930a7e1a0e426e89b3ccfb8d48d0aaf3a9d7e09aa90ffd28b
7
+ data.tar.gz: 5ed9dfd6b376bdfc28985076afe05240a9631d2a0c9bbabfba66525deab6b82802af1f380448c098c725b7848890e61860c40104799c5a0a330b22e596bfe14e
data/bin/go-import CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "thor"
4
- require "go_import"
4
+ require_relative '../lib/go_import'
5
5
  require 'progress'
6
6
 
7
+
7
8
  RUNNER_DIR = ".go_import"
8
9
 
9
10
  class GoImportCommandLine < Thor
@@ -20,9 +20,9 @@ module GoImport
20
20
  class InvalidDealStatusError < StandardError
21
21
  end
22
22
 
23
- class InvalidNoteClassificationError < StandardError
23
+ class InvalidHistoryClassificationError < StandardError
24
24
  def initalize(classification)
25
- super("#{classification} is not a valid note classification")
25
+ super("#{classification} is not a valid history classification")
26
26
  end
27
27
  end
28
28
 
@@ -2,7 +2,7 @@ module GoImport
2
2
  class DealStatus
3
3
  include SerializeHelper
4
4
 
5
- attr_accessor :id, :date, :status_reference, :note
5
+ attr_accessor :id, :date, :status_reference, :history
6
6
 
7
7
  def initialize(opt = nil)
8
8
  if opt != nil
@@ -14,7 +14,7 @@ module GoImport
14
14
  end
15
15
 
16
16
  def serialize_variables
17
- [ :id, :label, :note ].map{ |p| { :id => p, :type => :string } } +
17
+ [ :id, :label, :history ].map{ |p| { :id => p, :type => :string } } +
18
18
  [ :date ].map { |p| { :id => p, :type => :date } } +
19
19
  [ :status_reference ].map { |p| { :id => p, :type => :deal_status_reference } }
20
20
  end
@@ -1,5 +1,5 @@
1
1
  module GoImport
2
- class Note < CanBecomeImmutable
2
+ class History < CanBecomeImmutable
3
3
  include SerializeHelper
4
4
  immutable_accessor :id
5
5
  immutable_accessor :integration_id
@@ -8,8 +8,8 @@ module GoImport
8
8
  attr_reader :text
9
9
  attr_reader :organization, :created_by, :person, :deal
10
10
 
11
- # The note's classification. It should be a value from
12
- # {#NoteClassification}. The default value is Comment.
11
+ # The history classification. It should be a value from
12
+ # {#HistoryClassification}. The default value is Comment.
13
13
  attr_reader :classification
14
14
 
15
15
  def initialize(opt = nil)
@@ -20,7 +20,7 @@ module GoImport
20
20
  end
21
21
  end
22
22
 
23
- @classification = NoteClassification::Comment if @classification.nil?
23
+ @classification = HistoryClassification::Comment if @classification.nil?
24
24
  end
25
25
 
26
26
  def serialize_variables
@@ -49,7 +49,7 @@ module GoImport
49
49
  end
50
50
 
51
51
  def serialize_name
52
- "Note"
52
+ "History"
53
53
  end
54
54
 
55
55
  def organization=(org)
@@ -90,12 +90,12 @@ module GoImport
90
90
 
91
91
  def classification=(classification)
92
92
  raise_if_immutable
93
- if classification == NoteClassification::Comment || classification == NoteClassification::SalesCall ||
94
- classification == NoteClassification::TalkedTo || classification == NoteClassification::TriedToReach ||
95
- classification == NoteClassification::ClientVisit
93
+ if classification == HistoryClassification::Comment || classification == HistoryClassification::SalesCall ||
94
+ classification == HistoryClassification::TalkedTo || classification == HistoryClassification::TriedToReach ||
95
+ classification == HistoryClassification::ClientVisit
96
96
  @classification = classification
97
97
  else
98
- raise InvalidNoteClassificationError, classification
98
+ raise InvalidHistoryClassificationError, classification
99
99
  end
100
100
  end
101
101
 
@@ -126,16 +126,20 @@ module GoImport
126
126
  def validate
127
127
  error = String.new
128
128
 
129
- if @text.nil? || @text.empty?
130
- error = "Text is required for note\n"
129
+ if (@classification.nil? || @classification.empty?)
130
+ error = "Classification is required for history\n"
131
+ end
132
+
133
+ if (@text.nil? || @text.empty?) && classification != HistoryClassification::TriedToReach
134
+ error = "Text is required for history\n"
131
135
  end
132
136
 
133
137
  if @created_by.nil?
134
- error = "#{error}Created_by is required for note\n"
138
+ error = "#{error}Created_by is required for history\n"
135
139
  end
136
140
 
137
141
  if @organization.nil? && @deal.nil? && @person.nil?
138
- error = "#{error}Organization, deal or person is required for note\n"
142
+ error = "#{error}Organization, deal or person is required for history\n"
139
143
  end
140
144
 
141
145
  return error
@@ -1,23 +1,23 @@
1
1
  module GoImport
2
- # Defines a note's classification. This defines what kind of
3
- # action that happened before the note was written.
4
- module NoteClassification
2
+ # Defines a history type. This defines what kind of
3
+ # action that happened before the history was written.
4
+ module HistoryClassification
5
5
  # We talked to the client about a sale. This might be a phone call
6
6
  # or a talk in person.
7
- SalesCall = 0
7
+ SalesCall = 'SalesCall'
8
8
 
9
9
  # This is a general comment about the organization or deal.
10
- Comment = 1
10
+ Comment = 'Comment'
11
11
 
12
12
  # This is a general comment regarding a talk we had with
13
13
  # someone at the client.
14
- TalkedTo = 2
14
+ TalkedTo = 'TalkedTo'
15
15
 
16
16
  # We tried to reach someone but failed.
17
- TriedToReach = 3
17
+ TriedToReach = 'TriedToReach'
18
18
 
19
19
  # We had a meeting at the client's site.
20
- ClientVisit = 4
20
+ ClientVisit = 'ClientVisit'
21
21
  end
22
22
  end
23
23
 
@@ -8,10 +8,10 @@ module GoImport
8
8
  # The root model for Go import. This class is the container for everything else.
9
9
  class RootModel
10
10
  # the import_coworker is a special coworker that is set as
11
- # responsible for objects that requires a coworker, eg a note.
11
+ # responsible for objects that requires a coworker, eg a history.
12
12
  attr_accessor :import_coworker
13
13
 
14
- attr_accessor :settings, :organizations, :coworkers, :deals, :notes
14
+ attr_accessor :settings, :organizations, :coworkers, :deals, :histories
15
15
 
16
16
  # The configuration is used to set run-time properties for
17
17
  # go-import. This should not be confused with the model's
@@ -30,7 +30,7 @@ module GoImport
30
30
  {:id => :coworkers, :type => :coworkers},
31
31
  {:id => :organizations, :type => :organizations},
32
32
  {:id => :deals, :type => :deals},
33
- {:id => :notes, :type => :notes},
33
+ {:id => :histories, :type => :histories},
34
34
  {:id => :documents, :type => :documents},
35
35
  ]
36
36
  end
@@ -50,7 +50,7 @@ module GoImport
50
50
  @import_coworker.first_name = "Import"
51
51
  @coworkers[@import_coworker.integration_id] = @import_coworker
52
52
  @deals = {}
53
- @notes = {}
53
+ @histories = {}
54
54
  @documents = Documents.new
55
55
  @configuration = {}
56
56
 
@@ -171,41 +171,41 @@ module GoImport
171
171
  end
172
172
  end
173
173
 
174
- # Adds the specifed note object to the model.
174
+ # Adds the specifed history object to the model.
175
175
  #
176
176
  # If no integration_id has been specifed go-import generate
177
177
  # one.
178
178
  #
179
- # @example Add a note from a new note
180
- # note = GoImport::Note.new
181
- # note.integration_id = "123"
182
- # note.text = "This is a note"
183
- # rootmodel.add_note(note)
184
- def add_note(note)
185
- if note.nil?
179
+ # @example Add a history from a new history
180
+ # history = GoImport::History.new
181
+ # history.integration_id = "123"
182
+ # history.text = "This is a history"
183
+ # rootmodel.add_history(history)
184
+ def add_history(history)
185
+ if history.nil?
186
186
  return nil
187
187
  end
188
188
 
189
- if !note.is_a?(Note)
190
- raise ArgumentError.new("Expected a note")
189
+ if !history.is_a?(History)
190
+ raise ArgumentError.new("Expected a history")
191
191
  end
192
192
 
193
- if note.integration_id.nil? || note.integration_id.length == 0
194
- note.integration_id = @notes.length.to_s
193
+ if history.integration_id.nil? || history.integration_id.length == 0
194
+ history.integration_id = @histories.length.to_s
195
195
  end
196
196
 
197
- if find_note_by_integration_id(note.integration_id, false) != nil
198
- raise AlreadyAddedError, "Already added a note with integration_id #{note.integration_id}"
197
+ if find_history_by_integration_id(history.integration_id, false) != nil
198
+ raise AlreadyAddedError, "Already added a history with integration_id #{history.integration_id}"
199
199
  end
200
200
 
201
- if note.created_by.nil?
202
- note.created_by = @import_coworker
201
+ if history.created_by.nil?
202
+ history.created_by = @import_coworker
203
203
  end
204
204
 
205
- @notes[note.integration_id] = note
206
- note.set_is_immutable
205
+ @histories[history.integration_id] = history
206
+ history.set_is_immutable
207
207
 
208
- return note
208
+ return history
209
209
  end
210
210
 
211
211
  def add_link(link)
@@ -249,11 +249,11 @@ module GoImport
249
249
  return nil
250
250
  end
251
251
 
252
- def find_note_by_integration_id(integration_id, report_result=!!configuration[:report_result])
253
- if @notes.has_key?(integration_id)
254
- return @notes[integration_id]
252
+ def find_history_by_integration_id(integration_id, report_result=!!configuration[:report_result])
253
+ if @histories.has_key?(integration_id)
254
+ return @histories[integration_id]
255
255
  else
256
- report_failed_to_find_object("note", ":#{integration_id}") if report_result
256
+ report_failed_to_find_object("history", ":#{integration_id}") if report_result
257
257
  return nil
258
258
  end
259
259
  end
@@ -360,13 +360,13 @@ module GoImport
360
360
  end
361
361
 
362
362
 
363
- # Finds a note based on one of its property.
364
- # Returns the first found matching note
365
- # @example Finds a note on its name
366
- # rm.find_note {|note| note.text == "hello!" }
367
- def find_note(report_result=!!configuration[:report_result], &block)
368
- result = find(@notes.values.flatten, &block)
369
- report_failed_to_find_object("note") if result.nil? and report_result
363
+ # Finds a history based on one of its property.
364
+ # Returns the first found matching history
365
+ # @example Finds a history on its name
366
+ # rm.find_history {|history| history.text == "hello!" }
367
+ def find_history(report_result=!!configuration[:report_result], &block)
368
+ result = find(@histories.values.flatten, &block)
369
+ report_failed_to_find_object("history") if result.nil? and report_result
370
370
  return result
371
371
  end
372
372
 
@@ -434,7 +434,6 @@ module GoImport
434
434
 
435
435
  converter_deal_statuses = @settings.deal.statuses.map {|status| status.label} if @settings.deal != nil
436
436
  @deals.each do |key, deal|
437
- #@deals.each do |deal|
438
437
  error, warning = deal.validate converter_deal_statuses
439
438
 
440
439
  if !error.empty?
@@ -445,9 +444,8 @@ module GoImport
445
444
  end
446
445
  end
447
446
 
448
- #@notes.each do |note|
449
- @notes.each do |key, note|
450
- validation_message = note.validate
447
+ @histories.each do |key, history|
448
+ validation_message = history.validate
451
449
 
452
450
  if !validation_message.empty?
453
451
  errors = "#{errors}\n#{validation_message}"
@@ -474,7 +472,7 @@ module GoImport
474
472
  # @!visibility private
475
473
  def to_rexml(doc)
476
474
  element_name = serialize_name
477
- elem = doc.add_element(element_name,{"Version"=>"v2_0"})
475
+ elem = doc.add_element(element_name,{"Version"=>"v3_0"})
478
476
  SerializeHelper::serialize_variables_rexml(elem, self)
479
477
  end
480
478
 
@@ -504,7 +502,7 @@ module GoImport
504
502
  @organizations = []
505
503
  @coworkers = []
506
504
  @deals = []
507
- @notes = []
505
+ @histories = []
508
506
  @documents = saved_documents
509
507
  serialize_to_file(go_files_file)
510
508
 
@@ -563,7 +561,7 @@ module GoImport
563
561
  " Organizations: #{@organizations.length}\n" \
564
562
  " Persons: #{persons.length}\n" \
565
563
  " Deals: #{@deals.length}\n" \
566
- " Notes: #{@notes.length}\n" \
564
+ " Histories: #{@histories.length}\n" \
567
565
  " Documents: #{nbr_of_documents}"
568
566
  end
569
567
 
@@ -112,12 +112,12 @@ module GoImport
112
112
  map_symbol_to_row(p[:id],p[:type])
113
113
  when :date then
114
114
  map_symbol_to_row(p[:id],p[:type])
115
- when :notes then
115
+ when :histories then
116
116
  {
117
117
  :id => p[:id].to_s,
118
118
  :name => symbol_to_name(p[:id]),
119
119
  :type => p[:type],
120
- :models => SerializeHelper.get_import_rows(:note)
120
+ :models => SerializeHelper.get_import_rows(:history)
121
121
  }
122
122
  when :tags then
123
123
  {
@@ -171,8 +171,8 @@ module GoImport
171
171
  Person.new
172
172
  when :source_ref then
173
173
  ReferenceToSource.new
174
- when :note then
175
- Note.new
174
+ when :history then
175
+ History.new
176
176
  when :address then
177
177
  Address.new
178
178
  when :organization then
@@ -18,7 +18,7 @@ module GoImport
18
18
  }
19
19
  model.organizations.each{|key, org| add_organization(org)}
20
20
  model.deals.each{|key, deal| add_deal(deal)}
21
- model.notes.each{|key, note| add_note(note)}
21
+ model.histories.each{|key, history| add_history(history)}
22
22
  add_documents(model.documents)
23
23
 
24
24
  return_value = @shards
@@ -34,9 +34,9 @@ module GoImport
34
34
  end
35
35
 
36
36
  private
37
- def add_note(note)
37
+ def add_history(history)
38
38
  check_or_create_new_chard()
39
- @current_shard.add_note(note)
39
+ @current_shard.add_history(history)
40
40
  @current_shard_count += 1
41
41
  end
42
42
 
data/lib/go_import.rb CHANGED
@@ -1,20 +1,20 @@
1
1
  module GoImport
2
2
  private
3
3
  def self.require_all_in(folder)
4
- Dir.glob(File.join( File.dirname(File.absolute_path(__FILE__)),folder), &method(:require))
4
+ Dir.glob(::File.join(::File.dirname(::File.absolute_path(__FILE__)),folder), &method(:require))
5
5
  end
6
6
 
7
- require 'go_import/errors'
8
- require 'go_import/serialize_helper'
9
- require 'go_import/model_helpers'
10
- require 'go_import/can_become_immutable'
7
+ require_relative 'go_import/errors'
8
+ require_relative 'go_import/serialize_helper'
9
+ require_relative 'go_import/model_helpers'
10
+ require_relative 'go_import/can_become_immutable'
11
11
  GoImport::require_all_in 'go_import/model/*.rb'
12
- require 'go_import/csv_helper'
13
- require 'go_import/roo_helper'
14
- require 'go_import/phone_helper'
15
- require 'go_import/email_helper'
16
- require 'go_import/excel_helper'
17
- require 'go_import/templating'
18
- require 'go_import/source'
19
- require 'go_import/shard_helper'
12
+ require_relative 'go_import/csv_helper'
13
+ require_relative 'go_import/roo_helper'
14
+ require_relative 'go_import/phone_helper'
15
+ require_relative 'go_import/email_helper'
16
+ require_relative 'go_import/excel_helper'
17
+ require_relative 'go_import/templating'
18
+ require_relative 'go_import/source'
19
+ require_relative 'go_import/shard_helper'
20
20
  end
@@ -1 +1 @@
1
- This source converts a VISMA database to LIME Go.
1
+ This source converts a VISMA Administration 2000 database to LIME Go.
@@ -9,7 +9,7 @@ KUND_FILE = './database/KUND.DBF'
9
9
  KONTAKT_FILE = './database/KONTAKT.DBF'
10
10
 
11
11
  def convert_source
12
- puts "Trying to convert VISMA source to LIME Go..."
12
+ puts "Trying to convert VISMA Administration 2000 source to LIME Go..."
13
13
 
14
14
  # Verify that required files exists.
15
15
  if !File.exists?(KUND_FILE)
@@ -60,19 +60,19 @@ def convert_source
60
60
  end
61
61
  puts "Processed #{imported_person_count} Persons."
62
62
 
63
- # Notes must be owned by a coworker and the be added to
64
- # organizations and notes and might refernce a person
65
- puts "Trying to process Notes..."
66
- imported_note_count = 0
63
+ # History must be owned by a coworker and then should reference
64
+ # organization or deal and might reference a person
65
+ puts "Trying to process History..."
66
+ imported_history_count = 0
67
67
  organization_rows.each do |row|
68
68
  if not row.nil?
69
69
  if row['ANTECK_1'].length > 0
70
- rootmodel.add_note(converter.to_note(row))
71
- imported_note_count = imported_note_count + 1
70
+ rootmodel.add_history(converter.to_history(row))
71
+ imported_history_count = imported_history_count + 1
72
72
  end
73
73
  end
74
74
  end
75
- puts "Processed #{imported_note_count} Notes."
75
+ puts "Processed #{imported_history_count} History."
76
76
 
77
77
  return rootmodel
78
78
  end
@@ -1,7 +1,8 @@
1
1
  require 'go_import'
2
2
  require 'dbf'
3
3
 
4
- # Customize this file to suit your input for a VISMA database.
4
+ # Customize this file to suit your input for a
5
+ # VISMA Administration 2000 database.
5
6
  #
6
7
  # You must put KUND.DBS and KONTAKTER.DBS in the database folder.
7
8
  #
@@ -84,20 +85,20 @@ class Converter
84
85
  return organization
85
86
  end
86
87
 
87
- def to_note(row, rootmodel)
88
- note = GoImport::Note.new()
88
+ def to_history(row, rootmodel)
89
+ history = GoImport::History.new()
89
90
 
90
91
  # *** TODO:
91
92
  #
92
- # Set note properties from the row.
93
+ # Set history properties from the row.
93
94
  organization = rootmodel.find_organization_by_integration_id(row['KUNDNR'])
94
95
  unless organization.nil?
95
- note.organization = organization
96
+ history.organization = organization
96
97
  end
97
- note.created_by = rootmodel.import_coworker
98
- note.text = row['ANTECK_1']
98
+ history.created_by = rootmodel.import_coworker
99
+ history.text = row['ANTECK_1']
99
100
 
100
- return note
101
+ return history
101
102
  end
102
103
 
103
104
  def to_person(row, rootmodel)
@@ -120,15 +121,15 @@ class Converter
120
121
  # HOOKS
121
122
  #
122
123
  # Sometimes you need to add exra information to the rootmodel, this can be done
123
- # with hooks, below is an example of an organization hook that adds a note to
124
+ # with hooks, below is an example of an organization hook that adds a history to
124
125
  # an organization if a field has a specific value
125
126
  #def organization_hook(row, organization, rootmodel)
126
127
  # if not row['fieldname'].empty?
127
- # note = GoImport::Note.new
128
- # note.text = row['fieldname']
129
- # note.organization = organization
130
- # note.created_by = rootmodel.import_coworker
131
- # rootmodel.add_note(note)
128
+ # history = GoImport::History.new
129
+ # history.text = row['fieldname']
130
+ # history.organization = organization
131
+ # history.created_by = rootmodel.import_coworker
132
+ # rootmodel.add_history(history)
132
133
  # end
133
134
  #end
134
135
 
@@ -7,7 +7,7 @@ ORGANIZATION_FILE = "data/contacts.csv"
7
7
  LEADS_FILE = "data/leads.csv"
8
8
  PERSON_FILE = "data/contacts.csv"
9
9
  DEAL_FILE = "data/deals.csv"
10
- NOTE_FILE = "data/notes.csv"
10
+ HISTORY_FILE = "data/histories.csv"
11
11
  SOURCE_ENCODING = "utf-8"
12
12
 
13
13
 
@@ -24,7 +24,7 @@ def convert_source
24
24
  puts "Trying to convert Base CRM source to LIME Go..."
25
25
 
26
26
  converter = Converter.new
27
- ignored_notes = 0
27
+ ignored_histories = 0
28
28
  ignored_persons = 0
29
29
 
30
30
  # A rootmodel is used to represent all entitite/models that is
@@ -166,14 +166,14 @@ def convert_source
166
166
  organization.add_employee(person)
167
167
 
168
168
  if row['description']
169
- note = GoImport::Note.new()
169
+ history = GoImport::History.new()
170
170
 
171
- note.text = row['description']
172
- note.person = person
173
- note.organization = organization
174
- note.created_by = coworker
171
+ history.text = row['description']
172
+ history.person = person
173
+ history.organization = organization
174
+ history.created_by = coworker
175
175
 
176
- rootmodel.add_note(note)
176
+ rootmodel.add_history(history)
177
177
  end
178
178
  rootmodel.add_organization(organization)
179
179
  end
@@ -199,37 +199,37 @@ def convert_source
199
199
  end
200
200
  end
201
201
 
202
- # notes
203
- if defined?(NOTE_FILE) && !NOTE_FILE.nil? && !NOTE_FILE.empty?
204
- process_rows(NOTE_FILE, source_encoding) do |row|
205
- note = converter.to_note(row, rootmodel)
206
- note.integration_id = row['id']
207
- note.text = row['content']
208
- note.created_by = rootmodel.find_coworker_by_integration_id(row["owner"])
202
+ # historys
203
+ if defined?(HISTORY_FILE) && !HISTORY_FILE.nil? && !HISTORY_FILE.empty?
204
+ process_rows(HISTORY_FILE, source_encoding) do |row|
205
+ history = converter.to_history(row, rootmodel)
206
+ history.integration_id = row['id']
207
+ history.text = row['content']
208
+ history.created_by = rootmodel.find_coworker_by_integration_id(row["owner"])
209
209
  notable_id = row['noteable_id']
210
210
  case row["noteable_type"]
211
211
  when "Deal"
212
212
  deal = rootmodel.find_deal_by_integration_id(notable_id)
213
- note.deal = deal
213
+ history.deal = deal
214
214
  when "Lead"
215
- note.person = rootmodel.find_person_by_integration_id("p#{notable_id}")
216
- note.organization = rootmodel.find_organization_by_integration_id("l#{notable_id}")
215
+ history.person = rootmodel.find_person_by_integration_id("p#{notable_id}")
216
+ history.organization = rootmodel.find_organization_by_integration_id("l#{notable_id}")
217
217
  when "Contact"
218
- puts "Ignoreing note for unbound person: #{row['owner']}"
219
- ignored_notes += 1
218
+ puts "Ignoreing history for unbound person: #{row['owner']}"
219
+ ignored_histories += 1
220
220
  next
221
221
  else
222
222
  org = rootmodel.find_organization_by_integration_id(notable_id)
223
223
  if org.nil?
224
224
  person = rootmodel.find_person_by_integration_id(notable_id)
225
225
  org = person.organization
226
- note.person = person
226
+ history.person = person
227
227
  end
228
- note.organization = org
228
+ history.organization = org
229
229
  end
230
- rootmodel.add_note(note)
230
+ rootmodel.add_history(history)
231
231
  end
232
232
  end
233
- puts "Ignored #{ignored_persons} persons and #{ignored_notes} notes"
233
+ puts "Ignored #{ignored_persons} persons and #{ignored_histories} histories"
234
234
  return rootmodel
235
235
  end
@@ -53,10 +53,10 @@ class Converter
53
53
  return deal
54
54
  end
55
55
 
56
- def to_note(row, rootmodel)
57
- note = GoImport::Note.new()
56
+ def to_history(row, rootmodel)
57
+ history = GoImport::History.new()
58
58
  # All built in fields are automagically mapped. Add your custom stuff here...
59
- return note
59
+ return history
60
60
  end
61
61
 
62
62
  end
File without changes
@@ -203,15 +203,15 @@ class Converter
203
203
  # HOOKS
204
204
  #
205
205
  # Sometimes you need to add exra information to the rootmodel, this can be done
206
- # with hooks, below is an example of an organization hook that adds a note to
206
+ # with hooks, below is an example of an organization hook that adds a history to
207
207
  # an organization if a field has a specific value
208
208
  #def organization_hook(row, organization, rootmodel)
209
209
  # if not row['fieldname'].empty?
210
- # note = GoImport::Note.new
211
- # note.text = row['fieldname']
212
- # note.organization = organization
213
- # note.created_by = rootmodel.import_coworker
214
- # rootmodel.add_note(note)
210
+ # history = GoImport::History.new
211
+ # history.text = row['fieldname']
212
+ # history.organization = organization
213
+ # history.created_by = rootmodel.import_coworker
214
+ # rootmodel.add_history(history)
215
215
  # end
216
216
  #end
217
217