action_kit_api 0.4.5 → 0.4.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.
@@ -18,39 +18,20 @@ module ActionKitApi
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def save
|
21
|
-
|
22
21
|
class_name = self.class.to_s.split("::").last
|
23
22
|
|
24
23
|
raise MissingRequiredAttributeException unless self.valid?
|
25
24
|
|
26
25
|
if self.id.nil?
|
27
|
-
if self.respond_to?('before_create')
|
28
|
-
self.send('before_create')
|
29
|
-
end
|
30
|
-
|
31
26
|
call = "#{class_name}.create"
|
32
27
|
response = ActionKitApi.connection.call(call, self.safe_hash)
|
33
|
-
|
34
|
-
if self.respond_to?('after_create')
|
35
|
-
self.send('after_create')
|
36
|
-
end
|
37
28
|
else
|
38
|
-
if self.respond_to?('before_save')
|
39
|
-
self.send('before_save')
|
40
|
-
end
|
41
|
-
|
42
29
|
call = "#{class_name}.save_or_create"
|
43
30
|
response = ActionKitApi.connection.call(call, self.safe_hash)
|
44
|
-
|
45
|
-
if self.respond_to?('after_save')
|
46
|
-
self.send('after_save')
|
47
|
-
end
|
48
31
|
end
|
49
32
|
|
50
|
-
|
51
33
|
# Update ourselves to include the data that the server populated
|
52
34
|
self.update(response)
|
53
|
-
|
54
35
|
|
55
36
|
self
|
56
37
|
end
|
@@ -90,7 +71,7 @@ module ActionKitApi
|
|
90
71
|
|
91
72
|
next if key == :required_attrs
|
92
73
|
next if key == :read_only_attrs
|
93
|
-
user_hash[key] = self.instance_variable_get(iv)
|
74
|
+
user_hash[key] = self.instance_variable_get(iv).to_s
|
94
75
|
end
|
95
76
|
|
96
77
|
# XMLRPC::Client doesn't like empty values
|
@@ -43,8 +43,8 @@ module ActionKitApi
|
|
43
43
|
# Will not return private events, events that are full, deleted, or in the past
|
44
44
|
# and doesn't return extra fields
|
45
45
|
def public_search(*args)
|
46
|
-
args[0]
|
47
|
-
results = ActionKitApi.connection.call("
|
46
|
+
args[0].merge!(:campaign => self.id)
|
47
|
+
results = ActionKitApi.connection.call("Event.public_search", args)
|
48
48
|
|
49
49
|
results.map do |r|
|
50
50
|
Event.new(r)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 6
|
9
|
+
version: 0.4.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sam Stelfox
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-03-
|
17
|
+
date: 2012-03-16 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|