action_kit_api 0.4.0 → 0.4.1
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.
- data/lib/action_kit_api/event.rb +16 -1
- data/lib/action_kit_api/version.rb +1 -1
- metadata +2 -2
data/lib/action_kit_api/event.rb
CHANGED
@@ -23,8 +23,23 @@ module ActionKitApi
|
|
23
23
|
super
|
24
24
|
end
|
25
25
|
|
26
|
+
def signup(user)
|
27
|
+
raise "Can't signup to uncreated Event, please save" if self.id.nil?
|
28
|
+
|
29
|
+
event_campaign = ActionKitApi::EventCampaign.find_by_id(self.campaign_id)
|
30
|
+
|
31
|
+
action_attrs = {
|
32
|
+
:event_id => self.id,
|
33
|
+
:event_signup_ground_rules: 1,
|
34
|
+
:akid => user.akid,
|
35
|
+
:page: => "#{event_campaign.name}_attend"
|
36
|
+
}
|
37
|
+
|
38
|
+
ActionKitApi.act(action_attrs)
|
39
|
+
end
|
40
|
+
|
26
41
|
def cancel
|
27
|
-
raise "Can't cancel
|
42
|
+
raise "Can't cancel to uncreated Event, please save" if self.id.nil?
|
28
43
|
|
29
44
|
self.status = "cancelled"
|
30
45
|
self.save
|