maestrano-connector-rails 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a79840e36486cf0d47441ff04cc1c8a1ac83c41
4
- data.tar.gz: 1049ee41a84e02afdd8a1734345039a15f2a0798
3
+ metadata.gz: f267b4786215b5d645fc55e422f0f03225467fd6
4
+ data.tar.gz: e51ffb20f909c95602eb306ea74ea7e6910a3df5
5
5
  SHA512:
6
- metadata.gz: bc050b4d5e02bdad7debdc122a1e685ae8c3c0bf0c1582a4a6a490c2eb3282008e8e1eaebffa19023bea957d4edd9794d02bd5465e5ea9ff928d1c087ac7e9b3
7
- data.tar.gz: 0289a0746e8e25d34a2c15b9d624fbd8e1cf63a8a3da17d93cd33b3fbc4ee390e54050e00bcd6ed0f587c982e5b61a5add805d68ba93fa14e8189ef3ed65f492
6
+ metadata.gz: 9266c88d3068be3b351a9b1802c08ba69b355f413ff84065c7b05af74128a456be9570a1dcba3059d29ec6702d4ffb81bb38d8e27025cecdb1c7bef01f2c878c
7
+ data.tar.gz: f3c38b491d1cd4c584b6c37c9cef44f5aa45ec53952de0cb7d33f05131dbe63bb69a4ad2bb316cee900f7c127d45c3576c6464949a14d4f7bc6fbea55c4121d0
data/.rubocop_todo.yml CHANGED
@@ -28,7 +28,7 @@ Metrics/CyclomaticComplexity:
28
28
  # Offense count: 3
29
29
  # Configuration parameters: CountComments.
30
30
  Metrics/ModuleLength:
31
- Max: 206
31
+ Max: 217
32
32
 
33
33
  # Offense count: 2
34
34
  # Configuration parameters: CountKeywordArgs.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.1.1
2
+
3
+ ### Features
4
+ * Class names declared into ComplexEntities can now be camel case, spaced or underscored
5
+ * Logs have been added when an entity is not pushed to either Connec!/External (when push is disabled)
6
+
1
7
  ## 2.1.0
2
8
 
3
9
  ### Features
@@ -6,12 +12,26 @@
6
12
  * Organization and User can now be overridden in the connectors
7
13
  * Updates to layout of generated connectors
8
14
  * Option to push/pull disable for a specific Organization
9
- * Optional methods to limit currency updates
15
+ * Optional methods to limit currency updates
10
16
 
11
- ### Migration guide
17
+ ### Detailed Migration guide
12
18
  * Please refer to this document in the
13
19
  [Maestrano Guides](https://maestrano.atlassian.net/wiki/spaces/DEV/pages/102336339/Migration+Guides)
14
20
 
21
+ #### Quick Migration Checklist
22
+
23
+ * Add `webmock`
24
+ * Update `spec_helper` to require `webmock` and stub requests
25
+ * Add `to_connec.png` and `to_external.png` in your `assets/images/logos` folder
26
+ * Update `home.js` to support the Modal (Popping up when enabling historical data)
27
+ * Update `layout.sass` to correctly resize the logos
28
+ * Update your `home_controller.rb`
29
+ * Update your `home_controller_spec.rb` fil
30
+ * Update your `index.html.haml`
31
+ * Add `UpdateOrganizationMetadata` and `AddMetadataToIdMap` migrations
32
+
33
+
34
+
15
35
  ## 2.0.0
16
36
 
17
37
  ### Features
@@ -7,16 +7,21 @@ module Maestrano::Connector::Rails
7
7
  Entities.constants&.each do |c|
8
8
  klass = Entities.const_get(c)
9
9
  next unless klass.respond_to?(:formatted_external_entities_names)
10
- if klass.formatted_external_entities_names.values.include?(class_name.camelize) ||
11
- klass.formatted_connec_entities_names.values.include?(class_name.camelize)
12
- name = c
13
- break
14
- end
10
+
11
+ external_class_names = klass.formatted_external_entities_names.values
12
+ break name = c if camel_case_format(external_class_names).include?(class_name.camelize)
13
+
14
+ connec_class_names = klass.formatted_connec_entities_names.values
15
+ break name = c if camel_case_format(connec_class_names).include?(class_name.camelize)
15
16
  end
16
17
  name.to_s.underscore.to_sym
17
18
  else
18
19
  class_name.to_sym
19
20
  end
20
21
  end
22
+
23
+ def self.camel_case_format(array_of_class_names)
24
+ array_of_class_names.map { |name| name.titleize.delete(' ') }
25
+ end
21
26
  end
22
27
  end
@@ -257,7 +257,10 @@ module Maestrano::Connector::Rails::Concerns::Entity
257
257
  # * connec_id and push timestamp
258
258
  # * error message
259
259
  def push_entities_to_connec_to(mapped_external_entities_with_idmaps, connec_entity_name)
260
- return unless @organization.push_to_connec_enabled?(self)
260
+ unless @organization.push_to_connec_enabled?(self)
261
+ Maestrano::Connector::Rails::ConnectorLogger.log('info', @organization, "#{Maestrano::Connector::Rails::External.external_name}-#{self.class.external_entity_name.pluralize} not sent to Connec! Push disabled or name not found")
262
+ return
263
+ end
261
264
 
262
265
  Maestrano::Connector::Rails::ConnectorLogger.log('info', @organization, "Sending #{Maestrano::Connector::Rails::External.external_name} #{self.class.external_entity_name.pluralize} to Connec! #{connec_entity_name.pluralize}")
263
266
 
@@ -318,7 +321,10 @@ module Maestrano::Connector::Rails::Concerns::Entity
318
321
  # Pushes connec entities to the external application
319
322
  # Sends new external ids to Connec! (either only the id, or the id + the id references)
320
323
  def push_entities_to_external_to(mapped_connec_entities_with_idmaps, external_entity_name)
321
- return unless @organization.push_to_external_enabled?(self)
324
+ unless @organization.push_to_external_enabled?(self)
325
+ Maestrano::Connector::Rails::ConnectorLogger.log('info', @organization, "#{self.class.connec_entity_name.pluralize} not sent to External! Push disabled or name not found")
326
+ return
327
+ end
322
328
 
323
329
  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}")
324
330
 
@@ -1,7 +1,7 @@
1
1
  module Maestrano
2
2
  module Connector
3
3
  module Rails
4
- VERSION = '2.1.0'.freeze
4
+ VERSION = '2.1.1'.freeze
5
5
  end
6
6
  end
7
7
  end
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: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maestrano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails