maestrano-connector-rails 0.2.14 → 0.2.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60cc3a0fe4fd749682619befa70df6f687b5e208
|
4
|
+
data.tar.gz: d5b2db25bda76bb4d5d096a318652a2099715f2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aecf4f9d5b7233e6937868b1510d1356ccc4c551fa3fbc0ce8aee7680372f3a3bce4b43d1b0af00941133b598521ce607973abc1d91ed12875dfd70353bb5f10
|
7
|
+
data.tar.gz: 08f4f20f19fbd49e9627d499d724e1da97c6c34089d99d976c6aaac54c37d9c2d7f4ba7fcbfa39920e677fbc04554c4ec632f174708893882309d8cc83621db2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.15
|
@@ -46,9 +46,9 @@ class Maestrano::ConnecController < Maestrano::Rails::WebHookController
|
|
46
46
|
Maestrano::Connector::Rails::Entity.entities_list.each do |entity_name_from_list|
|
47
47
|
instance = "Entities::#{entity_name_from_list.singularize.titleize.split.join}".constantize.new
|
48
48
|
if instance.methods.include?('connec_entities_names'.to_sym)
|
49
|
-
return {instance: instance, is_complex: true, name: entity_name_from_list} if instance.connec_entities_names.include?(entity_name
|
49
|
+
return {instance: instance, is_complex: true, name: entity_name_from_list} if instance.connec_entities_names.map{|n| n.pluralize.downcase}.include?(entity_name)
|
50
50
|
elsif instance.methods.include?('connec_entity_name'.to_sym)
|
51
|
-
return {instance: instance, is_complex: false, name: entity_name_from_list} if instance.connec_entity_name == entity_name
|
51
|
+
return {instance: instance, is_complex: false, name: entity_name_from_list} if instance.connec_entity_name.pluralize.downcase == entity_name
|
52
52
|
end
|
53
53
|
end
|
54
54
|
nil
|
@@ -31,9 +31,9 @@ module Maestrano::Connector::Rails
|
|
31
31
|
Maestrano::Connector::Rails::Entity.entities_list.each do |entity_name_from_list|
|
32
32
|
instance = "Entities::#{entity_name_from_list.singularize.titleize.split.join}".constantize.new
|
33
33
|
if instance.methods.include?('external_entities_names'.to_sym)
|
34
|
-
return {instance: instance, is_complex: true, name: entity_name_from_list} if instance.external_entities_names.include?(entity_name
|
34
|
+
return {instance: instance, is_complex: true, name: entity_name_from_list} if instance.external_entities_names.include?(entity_name)
|
35
35
|
elsif instance.methods.include?('external_entity_name'.to_sym)
|
36
|
-
return {instance: instance, is_complex: false, name: entity_name_from_list} if instance.external_entity_name == entity_name
|
36
|
+
return {instance: instance, is_complex: false, name: entity_name_from_list} if instance.external_entity_name == entity_name
|
37
37
|
end
|
38
38
|
end
|
39
39
|
nil
|
@@ -2,11 +2,11 @@
|
|
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.2.
|
5
|
+
# stub: maestrano-connector-rails 0.2.15 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "maestrano-connector-rails"
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.15"
|
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"]
|
@@ -32,7 +32,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
context "with an unknown entity" do
|
35
|
-
let(:notifications) { {people
|
35
|
+
let(:notifications) { {'people' => [entity]} }
|
36
36
|
before {
|
37
37
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w())
|
38
38
|
}
|
@@ -44,7 +44,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
context "with a known complex entity" do
|
47
|
-
let(:notifications) { {
|
47
|
+
let(:notifications) { {'leads' => [entity]} }
|
48
48
|
|
49
49
|
before {
|
50
50
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w(contact_and_lead))
|
@@ -78,7 +78,7 @@ describe Maestrano::ConnecController, type: :controller do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
context "with a known non complex entity" do
|
81
|
-
let(:notifications) { {people
|
81
|
+
let(:notifications) { {'people' => [entity]} }
|
82
82
|
|
83
83
|
before {
|
84
84
|
allow(Maestrano::Connector::Rails::Entity).to receive(:entities_list).and_return(%w(person))
|