action_kit_api 0.3.10 → 0.3.11

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.
@@ -10,8 +10,9 @@ module ActionKitApi
10
10
 
11
11
  def initialize(hash = {})
12
12
  @required_attrs ||= []
13
+
13
14
  @read_only_attrs ||= []
14
- @read_only_attrs << :created_at << :updated_at
15
+ @read_only_attrs.concat([:created_at, :updated_at])
15
16
 
16
17
  self.update(hash)
17
18
  end
@@ -39,14 +39,21 @@ module ActionKitApi
39
39
  signup_page_name = "#{self.name}_signup"
40
40
  create_page_name = "#{self.name}_create"
41
41
 
42
- if ActionKitApi::EventSignupPage.find_by_name(signup_page_name).nil?
43
- signup_page = ActionKitApi::EventSignupPage.new(:name => signup_page_name, :title => "#{self.title} - Attend", :campaign_id => self.id)
44
- signup_page.save
42
+ # These two calls trigger an exception EVEN IF THEY SUCCEED
43
+ begin
44
+ if ActionKitApi::Page.find_by_name(signup_page_name).nil?
45
+ signup_page = ActionKitApi::EventSignupPage.new(:name => signup_page_name, :title => "#{self.title} - Attend", :campaign_id => self.id)
46
+ signup_page.save
47
+ end
48
+ rescue
45
49
  end
46
50
 
47
- if ActionKitApi::EventCreatePage.find_by_name(create_page_name).nil?
48
- create_page = ActionKitApi::EventCreatePage.new(:name => create_page_name, :title => "#{self.title} - Host", :campaign_id => self.id)
49
- create_page.save
51
+ begin
52
+ if ActionKitApi::Page.find_by_name(create_page_name).nil?
53
+ create_page = ActionKitApi::EventCreatePage.new(:name => create_page_name, :title => "#{self.title} - Host", :campaign_id => self.id)
54
+ create_page.save
55
+ end
56
+ rescue
50
57
  end
51
58
  end
52
59
 
@@ -20,6 +20,9 @@ module ActionKitApi
20
20
  @required_attrs ||= []
21
21
  @required_attrs.concat([:name, :title, :type])
22
22
 
23
+ @read_only_attrs ||= []
24
+ @read_only_attrs.concat([:hosted_with])
25
+
23
26
  super
24
27
  end
25
28
  end
@@ -1,3 +1,3 @@
1
1
  module ActionKitApi
2
- VERSION = "0.3.10"
2
+ VERSION = "0.3.11"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 10
9
- version: 0.3.10
8
+ - 11
9
+ version: 0.3.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sam Stelfox