ffcrm_cloudfuji 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  class EventRule < ActiveRecord::Base
2
-
2
+
3
3
  # event category validations
4
4
  validates_presence_of :event_category
5
5
  validates_presence_of :cloudfuji_event, :if => lambda { self.event_category == 'cloudfuji_event_received' }
@@ -13,7 +13,7 @@ class EventRule < ActiveRecord::Base
13
13
  validates_numericality_of :limit_per_lead, :only_integer => true, :allow_blank => true
14
14
 
15
15
  has_many :lead_event_rule_counts
16
-
16
+
17
17
  def process(lead, match_data)
18
18
  # How many times this rule has been applied to a given Lead
19
19
  count = LeadEventRuleCount.find_by_lead_id_and_event_rule_id(lead, self) ||
@@ -34,7 +34,7 @@ class EventRule < ActiveRecord::Base
34
34
  end
35
35
  end
36
36
  end
37
-
37
+
38
38
  # Actions
39
39
  # -----------------------------------------------------------------
40
40
  def change_lead_score(lead, match_data)
@@ -44,7 +44,7 @@ class EventRule < ActiveRecord::Base
44
44
  # Add history event to lead, to record change of score
45
45
  lead.versions.create! :event => "Rule for #{human_event_label}: Score changed by #{change_score_by} points. (New total: #{lead.score})"
46
46
  end
47
-
47
+
48
48
  def send_notification(lead, match_data)
49
49
  if ::Cloudfuji::Platform.on_cloudfuji?
50
50
  # Fire a Cloudfuji event
@@ -61,43 +61,43 @@ class EventRule < ActiveRecord::Base
61
61
 
62
62
  end
63
63
  end
64
-
64
+
65
65
  def add_tag(lead, match_data)
66
66
  lead.tag_list << tag
67
67
  save_lead_without_versioning_or_observers(lead)
68
68
  lead.versions.create! :event => "Rule for #{human_event_label}: Added tag '#{tag}'"
69
69
  end
70
-
70
+
71
71
  def remove_tag(lead, match_data)
72
72
  lead.tag_list -= [tag]
73
73
  save_lead_without_versioning_or_observers(lead)
74
74
  lead.versions.create! :event => "Rule for #{human_event_label}: Removed tag '#{tag}'"
75
75
  end
76
-
77
-
76
+
77
+
78
78
  private
79
-
79
+
80
80
  def event_matches?(match_data)
81
81
  test_string = case_insensitive_matching ? match.downcase : match
82
82
  case event_category
83
83
  when 'cloudfuji_event_received'
84
84
  match_string = match_data.inspect
85
85
  match_string.downcase! if case_insensitive_matching
86
- match_string.include?(test_string)
86
+ match_string.include?(test_string)
87
87
  when 'lead_attribute_changed'
88
- match_string = match_data[1].dup
88
+ match_string = match_data[1].to_s.dup
89
89
  match_string.downcase! if case_insensitive_matching
90
- match_string == test_string
90
+ match_string == test_string.to_s
91
91
  end
92
92
  end
93
-
93
+
94
94
  def human_event_label
95
95
  case event_category
96
96
  when 'cloudfuji_event_received'; "Cloudfuji event - '#{cloudfuji_event}'"
97
97
  when 'lead_attribute_changed'; "Lead update - '#{lead_attribute}'"
98
98
  end
99
99
  end
100
-
100
+
101
101
  def save_lead_without_versioning_or_observers(lead)
102
102
  Lead.observers.disable :cloudfuji_lead_observer do
103
103
  lead.without_versioning do
@@ -13,7 +13,7 @@ module FatFreeCRM
13
13
  # :human =>"Mail to s+cfdemo@cloudfuji.com successfully delievered."}}
14
14
  def email_delivered
15
15
  message = ""
16
- message += "Email delivered to #{recipient}"
16
+ message += "Email delivered to #{email}"
17
17
  message += " in email campaign '#{campaign.titleize}'" if campaign
18
18
 
19
19
  note_email_activity( message.strip )
@@ -29,7 +29,7 @@ module FatFreeCRM
29
29
  # :custom_variables=>nil
30
30
  def email_opened
31
31
  message = ""
32
- message += "Email opened by #{recipient}"
32
+ message += "Email opened by #{email}"
33
33
  message += " in email campaign '#{campaign.titleize}'" if campaign
34
34
 
35
35
  note_email_activity( message.strip )
@@ -46,7 +46,7 @@ module FatFreeCRM
46
46
  # :url=>"https://cloudfuji.com/cas/invite/?invitation_token=8hswc7kqhPys6FsUJ1Nm&service=https://cloudfuji.com/users/service&redirect=https://cloudfuji.com/apps/new?app=fat_free_crm&src=icon"
47
47
  # :human=>"s+cfdemo@cloudfuji.com clicked on link in Cloudfuji Buddies to https://cloudfuji.com/cas/invite/?invitation_token=8hswc7kqhPys6FsUJ1Nm&service=https://cloudfuji.com/users/service&redirect=https://cloudfuji.com/apps/new?app=fat_free_crm&src=icon"}
48
48
  def email_clicked
49
- message = "#{recipient} clicked #{data['url']}"
49
+ message = "#{email} clicked #{data['url']}"
50
50
  message += "in email campaign '#{campaign.titleize}'" if campaign
51
51
 
52
52
  note_email_activity(message)
@@ -54,7 +54,7 @@ module FatFreeCRM
54
54
 
55
55
 
56
56
  def email_subscribed
57
- note_email_activity("#{recipient} subscribed to a mailing list")
57
+ note_email_activity("#{email} subscribed to a mailing list")
58
58
  end
59
59
 
60
60
  private
@@ -86,9 +86,6 @@ module FatFreeCRM
86
86
  campaign
87
87
  end
88
88
 
89
- def recipient
90
- data['email'] || data['recipient']
91
- end
92
89
  end
93
90
  end
94
91
  end
@@ -1,5 +1,5 @@
1
1
  module FatFreeCRM
2
2
  module Cloudfuji
3
- VERSION = '0.2.9'
3
+ VERSION = '0.2.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,82 +1,103 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ffcrm_cloudfuji
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.10
4
5
  prerelease:
5
- version: 0.2.9
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Sean Grove
9
9
  - Nathan Broadbent
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2012-06-03 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
13
+ date: 2012-06-03 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: rspec-rails
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
19
+ requirements:
21
20
  - - ~>
22
- - !ruby/object:Gem::Version
23
- version: "2.6"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.6'
24
23
  type: :development
25
24
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '2.6'
31
+ - !ruby/object:Gem::Dependency
28
32
  name: capybara
29
- requirement: &id002 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
30
34
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
39
48
  name: combustion
40
- requirement: &id003 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
41
50
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
46
55
  type: :development
47
56
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
50
64
  name: cloudfuji
51
- requirement: &id004 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
52
66
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
56
70
  version: 0.0.45
57
71
  type: :runtime
58
72
  prerelease: false
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: 0.0.45
79
+ - !ruby/object:Gem::Dependency
61
80
  name: authlogic_cloudfuji
62
- requirement: &id005 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
63
82
  none: false
64
- requirements:
83
+ requirements:
65
84
  - - ~>
66
- - !ruby/object:Gem::Version
67
- version: "0.9"
85
+ - !ruby/object:Gem::Version
86
+ version: '0.9'
68
87
  type: :runtime
69
88
  prerelease: false
70
- version_requirements: *id005
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: '0.9'
71
95
  description: Integrates Fat Free CRM with the Cloudfuji hosting platform.
72
96
  email: s@cloudfuji.com
73
97
  executables: []
74
-
75
98
  extensions: []
76
-
77
99
  extra_rdoc_files: []
78
-
79
- files:
100
+ files:
80
101
  - .gitignore
81
102
  - .travis.yml
82
103
  - Gemfile
@@ -135,36 +156,32 @@ files:
135
156
  - uninstall.rb
136
157
  homepage: http://cloudfuji.com
137
158
  licenses: []
138
-
139
159
  post_install_message:
140
160
  rdoc_options: []
141
-
142
- require_paths:
161
+ require_paths:
143
162
  - lib
144
- required_ruby_version: !ruby/object:Gem::Requirement
163
+ required_ruby_version: !ruby/object:Gem::Requirement
145
164
  none: false
146
- requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- hash: -1653352338201941416
150
- segments:
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ segments:
151
170
  - 0
152
- version: "0"
153
- required_rubygems_version: !ruby/object:Gem::Requirement
171
+ hash: -429489658566264543
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
173
  none: false
155
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- hash: -1653352338201941416
159
- segments:
174
+ requirements:
175
+ - - ! '>='
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ segments:
160
179
  - 0
161
- version: "0"
180
+ hash: -429489658566264543
162
181
  requirements: []
163
-
164
182
  rubyforge_project:
165
- rubygems_version: 1.8.17
183
+ rubygems_version: 1.8.24
166
184
  signing_key:
167
185
  specification_version: 3
168
186
  summary: Fat Free CRM - Cloudfuji Integration
169
187
  test_files: []
170
-