maestrano-connector-rails 0.3.11 → 0.3.12
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 +4 -4
- data/VERSION +1 -1
- data/app/models/maestrano/connector/rails/concerns/complex_entity.rb +2 -2
- data/lib/generators/connector/templates/complex_entity_example/contact_and_lead.rb +2 -2
- data/lib/generators/connector/templates/entity.rb +2 -2
- data/lib/generators/connector/templates/home_controller_spec.rb +3 -12
- data/maestrano-connector-rails.gemspec +3 -3
- data/spec/models/complex_entity_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84ef649458c5d6f7cb94919594504d9ed0981716
|
4
|
+
data.tar.gz: 14a1c66e8e45ba44ae57f44f09a43ed9244a62e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9848a1d637b3d1feecb61c861ccd7f46279025b125b0732b696483c842b141436de0854c2c3b843d05502536c91c408cb747f45b4d07f90b9052785ba86db917
|
7
|
+
data.tar.gz: 250e0cd7eb986ff3d2fab3a2061ab33f18b876549c1cdda78a8e523295fe49557bf165b26ead63d8fba06ae072d9fbe214ab110e208d7c9b184d35dfcfd014b0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.12
|
@@ -28,7 +28,7 @@ module Maestrano::Connector::Rails::Concerns::ComplexEntity
|
|
28
28
|
# external_entities_names[1]: [unmapped_connec_entitiy4]
|
29
29
|
# }
|
30
30
|
# }
|
31
|
-
def connec_model_to_external_model(connec_hash_of_entities)
|
31
|
+
def connec_model_to_external_model(connec_hash_of_entities, organization)
|
32
32
|
raise "Not implemented"
|
33
33
|
end
|
34
34
|
|
@@ -45,7 +45,7 @@ module Maestrano::Connector::Rails::Concerns::ComplexEntity
|
|
45
45
|
# connec_entities_names[0]: [unmapped_external_entity3, unmapped_external_entity4]
|
46
46
|
# }
|
47
47
|
# }
|
48
|
-
def external_model_to_connec_model(external_hash_of_entities)
|
48
|
+
def external_model_to_connec_model(external_hash_of_entities, organization)
|
49
49
|
raise "Not implemented"
|
50
50
|
end
|
51
51
|
|
@@ -23,7 +23,7 @@
|
|
23
23
|
# # external_entities_names[1]: [unmapped_connec_entitiy4]
|
24
24
|
# # }
|
25
25
|
# # }
|
26
|
-
# def connec_model_to_external_model(connec_hash_of_entities)
|
26
|
+
# def connec_model_to_external_model(connec_hash_of_entities, organization)
|
27
27
|
# people = connec_hash_of_entities['person']
|
28
28
|
# modeled_connec_entities = {'person' => { 'lead' => [], 'contact' => [] }}
|
29
29
|
|
@@ -50,7 +50,7 @@
|
|
50
50
|
# # connec_entity_names[0]: [unmapped_external_entity3, unmapped_external_entity4]
|
51
51
|
# # }
|
52
52
|
# # }
|
53
|
-
# def external_model_to_connec_model(external_hash_of_entities)
|
53
|
+
# def external_model_to_connec_model(external_hash_of_entities, organization)
|
54
54
|
# return {'lead' => {'person' => external_hash_of_entities['lead']}, 'contact' => {'person' => external_hash_of_entities['contact']}}
|
55
55
|
# end
|
56
56
|
# end
|
@@ -15,11 +15,11 @@ class Maestrano::Connector::Rails::Entity
|
|
15
15
|
# Return an array of entities from the external app
|
16
16
|
def get_external_entities(client, last_synchronization, organization, opts={})
|
17
17
|
return [] unless self.class.can_read_external?
|
18
|
-
Maestrano::Connector::Rails::ConnectorLogger.log('info', organization, "Fetching #{Maestrano::Connector::Rails::External.external_name} #{self.external_entity_name.pluralize}")
|
18
|
+
Maestrano::Connector::Rails::ConnectorLogger.log('info', organization, "Fetching #{Maestrano::Connector::Rails::External.external_name} #{self.class.external_entity_name.pluralize}")
|
19
19
|
# TODO
|
20
20
|
# This method should return only entities that have been updated since the last_synchronization
|
21
21
|
# It should also implements an option to do a full synchronization when opts[:full_sync] == true or when there is no last_synchronization
|
22
|
-
# Maestrano::Connector::Rails::ConnectorLogger.log('info', organization, "Received data: Source=#{Maestrano::Connector::Rails::External.external_name}, Entity=#{self.external_entity_name}, Response=#{entities}")
|
22
|
+
# Maestrano::Connector::Rails::ConnectorLogger.log('info', organization, "Received data: Source=#{Maestrano::Connector::Rails::External.external_name}, Entity=#{self.class.external_entity_name}, Response=#{entities}")
|
23
23
|
end
|
24
24
|
|
25
25
|
def create_external_entity(client, mapped_connec_entity, external_entity_name, organization)
|
@@ -66,7 +66,7 @@ describe HomeController, :type => :controller do
|
|
66
66
|
|
67
67
|
context 'when user is not admin' do
|
68
68
|
before {
|
69
|
-
allow_any_instance_of(
|
69
|
+
allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(false)
|
70
70
|
}
|
71
71
|
|
72
72
|
it { expect(subject).to redirect_to back_path }
|
@@ -79,7 +79,7 @@ describe HomeController, :type => :controller do
|
|
79
79
|
|
80
80
|
context 'when user is admin' do
|
81
81
|
before {
|
82
|
-
allow_any_instance_of(
|
82
|
+
allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(true)
|
83
83
|
}
|
84
84
|
|
85
85
|
it { expect(subject).to redirect_to back_path }
|
@@ -107,17 +107,8 @@ describe HomeController, :type => :controller do
|
|
107
107
|
describe 'redirect_to_external' do
|
108
108
|
subject { get :redirect_to_external }
|
109
109
|
|
110
|
-
context 'when organization has a redirect url' do
|
111
|
-
let(:organization) { create(:organization, instance_url: 'url') }
|
112
|
-
before {
|
113
|
-
allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:current_organization).and_return(organization)
|
114
|
-
}
|
115
|
-
|
116
|
-
it {expect(subject).to redirect_to('url')}
|
117
|
-
end
|
118
|
-
|
119
110
|
context 'otherwise' do
|
120
|
-
it {expect(subject).to redirect_to('
|
111
|
+
it {expect(subject).to redirect_to('somewhere')}
|
121
112
|
end
|
122
113
|
end
|
123
114
|
end
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: maestrano-connector-rails 0.3.
|
5
|
+
# stub: maestrano-connector-rails 0.3.12 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "maestrano-connector-rails"
|
9
|
-
s.version = "0.3.
|
9
|
+
s.version = "0.3.12"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Pierre Berard"]
|
14
|
-
s.date = "2016-04-
|
14
|
+
s.date = "2016-04-08"
|
15
15
|
s.description = "Maestrano is the next generation marketplace for SME applications. See https://maestrano.com for details."
|
16
16
|
s.email = "pierre.berard@maestrano.com"
|
17
17
|
s.executables = ["rails"]
|
@@ -13,10 +13,10 @@ describe Maestrano::Connector::Rails::ComplexEntity do
|
|
13
13
|
it { expect{ subject.class.external_entities_names }.to raise_error('Not implemented') }
|
14
14
|
end
|
15
15
|
describe 'connec_model_to_external_model' do
|
16
|
-
it { expect{ subject.connec_model_to_external_model({}) }.to raise_error('Not implemented') }
|
16
|
+
it { expect{ subject.connec_model_to_external_model({}, nil) }.to raise_error('Not implemented') }
|
17
17
|
end
|
18
18
|
describe 'external_model_to_connec_model' do
|
19
|
-
it { expect{ subject.external_model_to_connec_model({}) }.to raise_error('Not implemented') }
|
19
|
+
it { expect{ subject.external_model_to_connec_model({}, nil) }.to raise_error('Not implemented') }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
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.3.
|
4
|
+
version: 0.3.12
|
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-04-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maestrano-rails
|