maestrano-connector-rails 0.2.20 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -157
- data/VERSION +1 -1
- data/app/controllers/maestrano/connec_controller.rb +6 -6
- data/app/jobs/maestrano/connector/rails/push_to_connec_job.rb +6 -7
- data/app/jobs/maestrano/connector/rails/synchronization_job.rb +2 -0
- data/app/models/maestrano/connector/rails/concerns/complex_entity.rb +15 -15
- data/app/models/maestrano/connector/rails/concerns/entity.rb +156 -140
- data/app/models/maestrano/connector/rails/concerns/sub_entity_base.rb +54 -50
- data/lib/generators/connector/templates/complex_entity_example/contact.rb +4 -4
- data/lib/generators/connector/templates/complex_entity_example/contact_and_lead.rb +3 -3
- data/lib/generators/connector/templates/complex_entity_example/lead.rb +4 -4
- data/lib/generators/connector/templates/complex_entity_example/person.rb +4 -4
- data/lib/generators/connector/templates/entity.rb +2 -2
- data/lib/generators/connector/templates/example_entity.rb +5 -5
- data/maestrano-connector-rails.gemspec +3 -4
- data/spec/controllers/connec_controller_spec.rb +3 -3
- data/spec/jobs/push_to_connec_job_spec.rb +4 -4
- data/spec/jobs/syncrhonization_job_spec.rb +3 -1
- data/spec/models/complex_entity_spec.rb +25 -24
- data/spec/models/entity_spec.rb +123 -103
- data/spec/models/sub_entity_base_spec.rb +92 -86
- data/template/maestrano-connector-template.rb +4 -3
- metadata +2 -3
- data/lib/generators/connector/templates/contact_and_lead.rb +0 -55
@@ -76,6 +76,7 @@ after_bundle do
|
|
76
76
|
remove_dir 'test'
|
77
77
|
remove_file 'app/views/layouts/application.html.erb'
|
78
78
|
remove_file 'app/assets/stylesheets/application.css'
|
79
|
+
remove_file 'config/routes.rb'
|
79
80
|
copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
|
80
81
|
copy_file 'factories.rb', 'spec/factories.rb'
|
81
82
|
copy_file 'routes.rb', 'config/routes.rb'
|
@@ -89,10 +90,10 @@ after_bundle do
|
|
89
90
|
RUBY
|
90
91
|
end
|
91
92
|
|
92
|
-
run 'rails g connector:install'
|
93
|
+
run 'bundle exec rails g connector:install'
|
93
94
|
run 'bundle exec figaro install'
|
94
|
-
run 'rake railties:install:migrations'
|
95
|
-
run 'rake db:migrate'
|
95
|
+
run 'bundle exec rake railties:install:migrations'
|
96
|
+
run 'bundle exec rake db:migrate'
|
96
97
|
|
97
98
|
# Init repo and commit
|
98
99
|
git :init
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maestrano-connector-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Berard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maestrano-rails
|
@@ -281,7 +281,6 @@ files:
|
|
281
281
|
- lib/generators/connector/templates/complex_entity_example/lead.rb
|
282
282
|
- lib/generators/connector/templates/complex_entity_example/lead_mapper.rb
|
283
283
|
- lib/generators/connector/templates/complex_entity_example/person.rb
|
284
|
-
- lib/generators/connector/templates/contact_and_lead.rb
|
285
284
|
- lib/generators/connector/templates/entity.rb
|
286
285
|
- lib/generators/connector/templates/example_entity.rb
|
287
286
|
- lib/generators/connector/templates/external.rb
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
# This file is provided as an example and should be removed
|
3
|
-
# class Entities::ContactAndLead < Maestrano::Connector::Rails::ComplexEntity
|
4
|
-
# def connec_entities_names
|
5
|
-
# %w(person)
|
6
|
-
# end
|
7
|
-
|
8
|
-
# def external_entities_names
|
9
|
-
# %w(contact lead)
|
10
|
-
# end
|
11
|
-
|
12
|
-
# # input : {
|
13
|
-
# # connec_entity_names[0]: [unmapped_connec_entitiy1, unmapped_connec_entitiy2],
|
14
|
-
# # connec_entity_names[1]: [unmapped_connec_entitiy3, unmapped_connec_entitiy4]
|
15
|
-
# # }
|
16
|
-
# # output : {
|
17
|
-
# # connec_entity_names[0]: {
|
18
|
-
# # external_entities_names[0]: [unmapped_connec_entitiy1, unmapped_connec_entitiy2]
|
19
|
-
# # },
|
20
|
-
# # connec_entity_names[1]: {
|
21
|
-
# # external_entities_names[0]: [unmapped_connec_entitiy3],
|
22
|
-
# # external_entities_names[1]: [unmapped_connec_entitiy4]
|
23
|
-
# # }
|
24
|
-
# # }
|
25
|
-
# def connec_model_to_external_model!(connec_hash_of_entities)
|
26
|
-
# people = connec_hash_of_entities['person']
|
27
|
-
# connec_hash_of_entities['person'] = { 'lead' => [], 'contact' => [] }
|
28
|
-
|
29
|
-
# people.each do |person|
|
30
|
-
# if person['is_lead']
|
31
|
-
# connec_hash_of_entities['person']['lead'] << person
|
32
|
-
# else
|
33
|
-
# connec_hash_of_entities['person']['contact'] << person
|
34
|
-
# end
|
35
|
-
# end
|
36
|
-
# end
|
37
|
-
|
38
|
-
# # input : {
|
39
|
-
# # external_entities_names[0]: [unmapped_external_entity1, unmapped_external_entity2],
|
40
|
-
# # external_entities_names[1]: [unmapped_external_entity3, unmapped_external_entity4]
|
41
|
-
# # }
|
42
|
-
# # output : {
|
43
|
-
# # external_entities_names[0]: {
|
44
|
-
# # connec_entity_names[0]: [unmapped_external_entity1],
|
45
|
-
# # connec_entity_names[1]: [unmapped_external_entity2]
|
46
|
-
# # },
|
47
|
-
# # external_entities_names[1]: {
|
48
|
-
# # connec_entity_names[0]: [unmapped_external_entity3, unmapped_external_entity4]
|
49
|
-
# # }
|
50
|
-
# # }
|
51
|
-
# def external_model_to_connec_model!(external_hash_of_entities)
|
52
|
-
# external_hash_of_entities['lead'] = { 'person' => external_hash_of_entities['lead'] }
|
53
|
-
# external_hash_of_entities['contact'] = { 'person' => external_hash_of_entities['contact'] }
|
54
|
-
# end
|
55
|
-
# end
|