action_kit_api 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,8 +11,7 @@ module ActionKitApi
|
|
11
11
|
def initialize(hash = {})
|
12
12
|
@required_attrs ||= []
|
13
13
|
@read_only_attrs ||= []
|
14
|
-
@read_only_attrs << :created_at
|
15
|
-
@read_only_attrs << :updated_at
|
14
|
+
@read_only_attrs << :created_at << :updated_at
|
16
15
|
|
17
16
|
self.update(hash)
|
18
17
|
end
|
@@ -62,7 +61,10 @@ module ActionKitApi
|
|
62
61
|
user_hash = {}
|
63
62
|
|
64
63
|
self.instance_variables.each do |iv|
|
65
|
-
|
64
|
+
if iv.is_a? String
|
65
|
+
key = iv.delete("@").to_sym
|
66
|
+
end
|
67
|
+
|
66
68
|
next if key == :required_attrs
|
67
69
|
next if key == :read_only_attrs
|
68
70
|
user_hash[key] = self.instance_variable_get(iv)
|
data/lib/action_kit_api/event.rb
CHANGED
@@ -17,7 +17,7 @@ module ActionKitApi
|
|
17
17
|
|
18
18
|
def initialize(*args)
|
19
19
|
@required_attrs = [:campaign, :creator, :title]
|
20
|
-
@read_only_attrs =[:attendee_count]
|
20
|
+
@read_only_attrs = [:attendee_count]
|
21
21
|
|
22
22
|
super
|
23
23
|
end
|
@@ -25,8 +25,8 @@ module ActionKitApi
|
|
25
25
|
def cancel
|
26
26
|
raise "Can't cancel unsaved Event" if self.id.nil?
|
27
27
|
|
28
|
-
status "cancelled"
|
29
|
-
save
|
28
|
+
self.status = "cancelled"
|
29
|
+
self.save
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|