mautic 0.1.4 → 0.1.6
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/lib/mautic/model.rb +25 -3
- data/lib/mautic/version.rb +1 -1
- metadata +3 -4
- data/app/models/application_record.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae603a459a430f1c56f626d53b5e124d8b8c8c7c
|
4
|
+
data.tar.gz: 2fe7b84ed8f84132d9de88d087f3c19be9289d14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8e55980f0f3f508459e071848fdb177b90a084eb7931b6c0e34a9b9fddd57ebe34c3a08aae02a2a96d247ede0dd161610c7e565b9d316823653f4f7b6746058
|
7
|
+
data.tar.gz: 5505b22d15af7b959b536a1ec00e437051a4a49ac1281593bee90e3bc64cb52b9013886cd9981d5835574c07ad293d70895477649efdb105d454087e0600d78d
|
data/lib/mautic/model.rb
CHANGED
@@ -15,6 +15,14 @@ module Mautic
|
|
15
15
|
|
16
16
|
end
|
17
17
|
|
18
|
+
class Attribute < OpenStruct
|
19
|
+
|
20
|
+
def name
|
21
|
+
@alias
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
18
26
|
class << self
|
19
27
|
|
20
28
|
def endpoint
|
@@ -30,7 +38,7 @@ module Mautic
|
|
30
38
|
def initialize(connection, hash=nil)
|
31
39
|
@connection = connection
|
32
40
|
@table = MauticHash.new
|
33
|
-
self.attributes = { created_at: hash['dateAdded']&.to_time, updated_at: hash['dateModified']&.to_time } if hash
|
41
|
+
self.attributes = { id: hash['id'], created_at: hash['dateAdded']&.to_time, updated_at: hash['dateModified']&.to_time } if hash
|
34
42
|
assign_attributes(hash)
|
35
43
|
clear_changes
|
36
44
|
end
|
@@ -100,10 +108,24 @@ module Mautic
|
|
100
108
|
end
|
101
109
|
|
102
110
|
def assign_attributes(source = nil)
|
111
|
+
@mautic_attributes = []
|
103
112
|
source ||= {}
|
104
113
|
data = {}
|
114
|
+
|
105
115
|
if (fields = source['fields'])
|
106
|
-
|
116
|
+
if fields['all']
|
117
|
+
@mautic_attributes = fields['all'].collect do |key, value|
|
118
|
+
data[key] = value
|
119
|
+
Attribute.new(alias: key, value: value)
|
120
|
+
end
|
121
|
+
else
|
122
|
+
fields.each do |_group, pairs|
|
123
|
+
pairs.each do |key, attrs|
|
124
|
+
@mautic_attributes << (a = Attribute.new(attrs))
|
125
|
+
data[key] = a.value
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
107
129
|
elsif source
|
108
130
|
data = source
|
109
131
|
end
|
@@ -111,4 +133,4 @@ module Mautic
|
|
111
133
|
end
|
112
134
|
|
113
135
|
end
|
114
|
-
end
|
136
|
+
end
|
data/lib/mautic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mautic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukáš Pokorný
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -191,7 +191,6 @@ files:
|
|
191
191
|
- app/helpers/mautic/application_helper.rb
|
192
192
|
- app/jobs/mautic/application_job.rb
|
193
193
|
- app/mailers/mautic/application_mailer.rb
|
194
|
-
- app/models/application_record.rb
|
195
194
|
- app/models/mautic/application_record.rb
|
196
195
|
- app/models/mautic/connection.rb
|
197
196
|
- app/models/mautic/connections/oauth2.rb
|
@@ -235,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
234
|
version: '0'
|
236
235
|
requirements: []
|
237
236
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.6.
|
237
|
+
rubygems_version: 2.6.14
|
239
238
|
signing_key:
|
240
239
|
specification_version: 4
|
241
240
|
summary: Ruby on Rails Mautic integration
|