maestrano-connector-rails 1.0.2 → 1.0.3

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: b6c98a08a281bfea7334aa9670a91b0e6f49a85e
4
- data.tar.gz: 6800242ca6b7d834df0d4acd6128541f8adf7f4d
3
+ metadata.gz: e857fececce75be28dbb9c7b04d0fb0b1dbc888b
4
+ data.tar.gz: 1a5e21c86c3848d8c352e93cacff1b7a59258177
5
5
  SHA512:
6
- metadata.gz: 78d4add0da696a67f179f24de422e65b9f84dc0eed4ef1108c89c17c917e089afd58acd2423b754eeb3342272136c6460d6f679229bb7f110b11c9e3809014b1
7
- data.tar.gz: c2c008d2c6ce5387b0a527b359b23af8669ffc7b3b094fe7676c752318a950297178be80c4e3c7372ae25732d88e0b9f06fe2aded0d3a9328a739057fc345d3e
6
+ metadata.gz: 1d840af38306358956d6c6bcb1af17683563c1bae227fc1d03b91bdc6864b21304d2a01d1939ad50aa09466a3fe214c35b7377c3c25d1e11ff17ff4dab3ad091
7
+ data.tar.gz: 34d928a71801a4f1dd7bd80e640f112af27a544439e2a96460e116636db7324f76640f277c956fa1c4930721e8489dc591b7013d93fa2c4607d370f24ebe1486
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -63,7 +63,7 @@ module Maestrano::Connector::Rails
63
63
  end
64
64
 
65
65
  def sync_entity(entity_name, organization, connec_client, external_client, last_synchronization, opts)
66
- entity_instance = "Entities::#{entity_name.titleize.split.join}".constantize.new(organization, connec_client, external_client, opts)
66
+ entity_instance = "Entities::#{entity_name.titleize.split.join}".constantize.new(organization, connec_client, external_client, opts.dup)
67
67
 
68
68
  entity_instance.before_sync(last_synchronization)
69
69
  external_entities = entity_instance.get_external_entities_wrapper(last_synchronization)
@@ -239,7 +239,8 @@ module Maestrano::Connector::Rails::Concerns::Entity
239
239
 
240
240
  Maestrano::Connector::Rails::ConnectorLogger.log('info', @organization, "Sending Connec! #{self.class.connec_entity_name.pluralize} to #{Maestrano::Connector::Rails::External.external_name} #{external_entity_name.pluralize}")
241
241
  ids_to_send_to_connec = mapped_connec_entities_with_idmaps.map{ |mapped_connec_entity_with_idmap|
242
- push_entity_to_external(mapped_connec_entity_with_idmap, external_entity_name)
242
+ idmap = push_entity_to_external(mapped_connec_entity_with_idmap, external_entity_name)
243
+ idmap ? {idmap: idmap} : nil
243
244
  }.compact
244
245
 
245
246
  unless ids_to_send_to_connec.empty?
@@ -260,7 +261,7 @@ module Maestrano::Connector::Rails::Concerns::Entity
260
261
  connec_id = idmap.connec_id
261
262
  external_id = create_external_entity(mapped_connec_entity, external_entity_name)
262
263
  idmap.update(external_id: external_id, last_push_to_external: Time.now, message: nil)
263
- return {idmap: idmap}
264
+ return idmap
264
265
 
265
266
  # Update
266
267
  else
@@ -271,7 +272,7 @@ module Maestrano::Connector::Rails::Concerns::Entity
271
272
  if self.class.singleton? && idmap.last_push_to_external.nil?
272
273
  connec_id = mapped_connec_entity_with_idmap[:idmap].connec_id
273
274
  idmap.update(last_push_to_external: Time.now, message: nil)
274
- return {idmap: idmap}
275
+ return idmap
275
276
  else
276
277
  idmap.update(last_push_to_external: Time.now, message: nil)
277
278
  end
@@ -15,7 +15,7 @@
15
15
 
16
16
  # describe 'instance methods' do
17
17
  # let(:organization) { create(:organization) }
18
- # let(:connec_client) { Maestrano::Connec::Client[organization.tenant].new(organization.uid) }
18
+ # let(:connec_client) { Maestrano::Connector::Rails::ConnecHelper.get_client(organization) }
19
19
  # let(:external_client) { Maestrano::Connector::Rails::External.get_client(organization) }
20
20
  # let(:opts) { {} }
21
21
  # subject { Entities::ExampleEntity.new(organization, connec_client, external_client, opts) }
@@ -46,7 +46,7 @@
46
46
  # it { expect(subject.map_to_connec(external_hash)).to eql(mapped_external_hash) }
47
47
  # end
48
48
 
49
- # describe 'connec to salesforce' do
49
+ # describe 'connec to external' do
50
50
  # let(:connec_hash) {
51
51
  # {
52
52
  # "first_name" => "John",
@@ -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 1.0.2 ruby lib
5
+ # stub: maestrano-connector-rails 1.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "maestrano-connector-rails"
9
- s.version = "1.0.2"
9
+ s.version = "1.0.3"
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-05-27"
14
+ s.date = "2016-06-07"
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"]
data/release_notes.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.0.2
2
+
3
+ ### Fixes
4
+ * Fix an issue with integer ids
5
+
6
+ ## 1.0.1
7
+
8
+ ### Fixes
9
+ * Fix an issue with singleton entities
10
+
1
11
  ## 1.0.0
2
12
 
3
13
  ### Features
@@ -574,9 +574,9 @@ describe Maestrano::Connector::Rails::Entity do
574
574
  expect(idmap2.last_push_to_external).to_not be_nil
575
575
  end
576
576
 
577
- it 'returns an hash with the idmap' do
577
+ it 'returns the idmap' do
578
578
  allow(subject).to receive(:create_external_entity).and_return('999111')
579
- expect(subject.push_entity_to_external(entity_with_idmap2, external_name)).to eql({idmap: idmap2})
579
+ expect(subject.push_entity_to_external(entity_with_idmap2, external_name)).to eql(idmap2)
580
580
  end
581
581
  end
582
582
 
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: 1.0.2
4
+ version: 1.0.3
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-05-27 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maestrano-rails