ish_manager 0.1.8.431 → 0.1.8.432

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6f1b0f07e5b49a3f1aef9c15acb767d8c02420d20be6875d523b319297cd31b
4
- data.tar.gz: 5ed7d17e31bd4873a9d06f8e7375c576059211ad122cc6e48659f6931174f127
3
+ metadata.gz: dd0cc9c3f7227cdc6dca94c10dd16da556553975d117cc827718e9b15c659d1b
4
+ data.tar.gz: e4903fe1cd5bc4526febd2707a18608f5bd4c64e3c8d4c5ec1763ed5e8c55930
5
5
  SHA512:
6
- metadata.gz: 699e248f1b23b586ba81734afc67ce008ac48264c3a0980ad8841f595f771c5edaeeda6409178cc7eab394d695ee51944e551687ff564020faef0d7d8a172fa8
7
- data.tar.gz: 0f2521916b15ffe1980fa17d5f46ef307d2fb9fab954f05ee796b669c4e7c2edb041b6375119f085635f9062ef4dcafbc942c67ad7c20c36297939e4703d3dd2
6
+ metadata.gz: a42652c42a41b2608f759a2789b737ab12c697a5cd3eeae1a78d82ba7afef7167b0c5f9cdeded3fc22702425cf9c85674b42e18125b4852f8471962834aee2fc
7
+ data.tar.gz: 813787a6cad45c7cdbe1a9485058ba900a4f3027aad8a9d83ff8a53b32a6955ac1da1a89b5afbc97aa1ca9afcf981716400d7c8041ddbf1ff55938d14e30cf74
@@ -23,7 +23,9 @@
23
23
  justify-content: center;
24
24
  }
25
25
  }
26
- .ctxs {
26
+
27
+ th.ctxs,
28
+ td.ctxs {
27
29
  text-align: center;
28
30
  }
29
31
  .email-actions--form {
@@ -70,28 +70,28 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
70
70
  end
71
71
  @leads = @leads.page( params[:leads_page ] ).per( current_profile.per_page )
72
72
 
73
- @email_contexts = {}
74
- lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
75
- map = %Q{
76
- function() {
77
- emit(this.to_email, {count: 1})
78
- }
79
- }
80
- reduce = %Q{
81
- function(key, values) {
82
- var result = {count: 0};
83
- values.forEach(function(value) {
84
- result.count += value.count;
85
- });
86
- return result;
87
- }
88
- }
89
- tmp_contexts = Ish::EmailContext.all.where( :to_email.in => lead_emails
90
- ).map_reduce( map, reduce
91
- ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
92
- ).to_a
93
- tmp_contexts.map { |x| @email_contexts[x[:_id]] = x[:value][:count].to_i }
94
- puts! @email_contexts, '@email_contexts'
73
+ # @email_contexts = {}
74
+ # # lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
75
+ # lead_ids = @leads.map( &:id )
76
+ # map = %Q{
77
+ # function() {
78
+ # emit(''+this.lead_id, {count: 1})
79
+ # }
80
+ # }
81
+ # reduce = %Q{
82
+ # function(key, values) {
83
+ # var result = {count: 0};
84
+ # values.forEach(function(value) {
85
+ # result.count += value.count;
86
+ # });
87
+ # return result;
88
+ # }
89
+ # }
90
+ # tmp_contexts = Ish::EmailContext.all.where( :lead_id.in => lead_ids
91
+ # ).map_reduce( map, reduce
92
+ # ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
93
+ # ).to_a
94
+ # tmp_contexts.map { |x| @email_contexts[x[:_id]] = x[:value][:count].to_i }
95
95
 
96
96
  end
97
97
 
@@ -1,8 +1,8 @@
1
1
 
2
2
  -#
3
- -# receives locals: leads , email_contexts , search_path
3
+ -# receives locals: leads , search_path
4
4
  -#
5
- - email_contexts ||= {}
5
+ -# - email_contexts ||= {}
6
6
 
7
7
  .leads--index.padded
8
8
  .header
@@ -51,7 +51,10 @@
51
51
  %td= lead.wp_tags.map(&:name).join(", ")
52
52
  %td= lead.created_at.to_s[0..10]
53
53
  %td.ctxs
54
- = email_contexts[lead.email]&.length || '-'
54
+ = lead.email_contexts.length
55
+ -## without the N+1 but unfinished and messy:
56
+ -# = email_contexts[lead.id] || '-'
57
+
55
58
  %td.sch
56
59
  = lead.scheduled_email_actions.length
57
60
  = link_to '[+]', new_scheduled_email_action_path( lead_id: lead.id )
@@ -1,2 +1,3 @@
1
1
 
2
- = render 'index', leads: @leads, email_contexts: @email_contexts, search_path: leads_path
2
+ = @email_contexts
3
+ = render 'index', leads: @leads, search_path: leads_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.431
4
+ version: 0.1.8.432
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox