ffcrm_cloudfuji 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,18 +7,18 @@
7
7
  regexp = new RegExp('new_event_rule', 'g')
8
8
  $('ul#event_rules').append(content.replace(regexp, new_id))
9
9
  # Setup event autocomplete for new field
10
- this.cloudfuji_event_autocomplete('input#event_rules_'+new_id+'_cloudfuji_event')
10
+ this.cloudfuji_event_autocomplete("input#event_rules_#{new_id}_cloudfuji_event")
11
11
 
12
12
  remove_fields: (button) ->
13
13
  container = $(button).closest('li.event_rule')
14
14
  index = container.data('index')
15
15
  # If rule has no id, just remove
16
- if $("#event_rules_"+index+"_id").length == 0
16
+ if $("#event_rules_#{index}_id").length == 0
17
17
  container.remove()
18
18
  else
19
19
  # If rule has an id, mark container as hidden and add _destroy field
20
20
  container.hide()
21
- container.append($('<input type="text" name="event_rules['+index+'][_destroy]" value="yes">'))
21
+ container.append($("<input type='text' name='event_rules[#{index}][_destroy]' value='yes'>"))
22
22
 
23
23
  cloudfuji_event_autocomplete: (selector = 'input.cloudfuji_event') ->
24
24
  $(selector).autocomplete({source: observed_cloudfuji_events, minLength: 0})
@@ -29,8 +29,8 @@
29
29
  show_field_group: (select, group_name, key) ->
30
30
  # Hide all fields, then show the selected field group
31
31
  container = $(select).closest('li.event_rule')
32
- container.find('.'+group_name+'_fields').hide()
33
- container.find('.'+group_name+'_'+key).show()
32
+ container.find(".#{group_name}_fields").hide()
33
+ container.find(".#{group_name}_#{key}").show()
34
34
 
35
35
  $(document).ready ->
36
36
  event_rules = new EventRules()
@@ -42,8 +42,11 @@ module FatFreeCRM
42
42
  return result if result
43
43
  end
44
44
 
45
- lead = Lead.find_by_ido_id(data['customer_ido_id'])
46
- lead ||= Lead.find_by_email(data['email'])
45
+ lead = if data['customer_ido_id'].present?
46
+ Lead.find_by_ido_id(data['customer_ido_id'])
47
+ else
48
+ Lead.find_by_email(data['email'])
49
+ end
47
50
  lead ||= Lead.new
48
51
 
49
52
  lead.email = data['email']
@@ -79,8 +79,11 @@ module FatFreeCRM
79
79
  end
80
80
 
81
81
  puts "No pre-existing records found, creating a lead"
82
- lead = Lead.find_by_ido_id(data['customer_ido_id'])
83
- lead ||= Lead.find_by_email(recipient)
82
+ lead = if data['customer_ido_id'].present?
83
+ Lead.find_by_ido_id(data['customer_ido_id'])
84
+ else
85
+ Lead.find_by_email(recipient)
86
+ end
84
87
  lead ||= Lead.new
85
88
 
86
89
  lead.email = recipient
@@ -7,8 +7,12 @@ module FatFreeCRM
7
7
  data = params['data']
8
8
  email = data['email'] || data['recipient']
9
9
  # Look up Lead by ido_id, fall back to email address
10
- lead = Lead.find_by_ido_id(data['customer_ido_id'])
11
- if lead ||= Lead.find_by_email(email)
10
+ lead = if data['customer_ido_id'].present?
11
+ Lead.find_by_ido_id(data['customer_ido_id'])
12
+ else
13
+ Lead.find_by_email(email)
14
+ end
15
+ if lead
12
16
  event_name = "#{params['category']}_#{params['event']}"
13
17
 
14
18
  EventRule.find_all_by_event_category_and_cloudfuji_event('cloudfuji_event_received', event_name).each do |rule|
@@ -16,7 +20,7 @@ module FatFreeCRM
16
20
  end
17
21
  end
18
22
  end
19
-
23
+
20
24
  end
21
25
  end
22
26
  end
@@ -1,5 +1,5 @@
1
1
  module FatFreeCRM
2
2
  module Cloudfuji
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
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.3
4
5
  prerelease:
5
- version: 0.2.2
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-05-25 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
13
+ date: 2012-05-28 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.42
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.42
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
@@ -132,36 +153,32 @@ files:
132
153
  - uninstall.rb
133
154
  homepage: http://cloudfuji.com
134
155
  licenses: []
135
-
136
156
  post_install_message:
137
157
  rdoc_options: []
138
-
139
- require_paths:
158
+ require_paths:
140
159
  - lib
141
- required_ruby_version: !ruby/object:Gem::Requirement
160
+ required_ruby_version: !ruby/object:Gem::Requirement
142
161
  none: false
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- hash: -827916366021811991
147
- segments:
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ segments:
148
167
  - 0
149
- version: "0"
150
- required_rubygems_version: !ruby/object:Gem::Requirement
168
+ hash: -3963537201467931072
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
151
170
  none: false
152
- requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- hash: -827916366021811991
156
- segments:
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ segments:
157
176
  - 0
158
- version: "0"
177
+ hash: -3963537201467931072
159
178
  requirements: []
160
-
161
179
  rubyforge_project:
162
- rubygems_version: 1.8.17
180
+ rubygems_version: 1.8.24
163
181
  signing_key:
164
182
  specification_version: 3
165
183
  summary: Fat Free CRM - Cloudfuji Integration
166
184
  test_files: []
167
-