ish_models 0.0.33.201 → 0.0.33.203

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: 5f7b84c12b393ec05bb90bf8b5f0cbebf9f56b4a03cc7109024721da40267834
4
- data.tar.gz: 9e9f21da6318f174be8e1ad53d6d04ae39554bc7b0fcb4f158930deda6387e77
3
+ metadata.gz: d743720d7da4d999732d7d28b69fe0697eaa73423d8fbb8f00866409eb857ed6
4
+ data.tar.gz: da958d68e0f40daedef7356725afba4a063713315e5ef756396355700f49f710
5
5
  SHA512:
6
- metadata.gz: 87be8ad0b221c7ead2a100b14e752bc67c32a6fe7b941d1153f92aa857050e3ebd3e775d74a8708ebec523585f791797d19f9a5fe0f479cad2df810fd025810a
7
- data.tar.gz: 063d5e1a5d5fe71c7c3545768869d01c9c1461aa4bc14c2b958526c5be8232ae013a37ae8952b716d5f3c5ac6c7a36de8fc938df7e51d17f23ca16ac61b7923f
6
+ metadata.gz: 210e40b9e0033207fb621b7d999227b638187f62937836885691b96206b4950ef01c5818d67fbef9fa5b456d5cf41a83b0f9974beda2e677662677315ba46b71
7
+ data.tar.gz: 6e0519979624398d04c9406f8ade0df6be50fa062f6dc8aafdf1cec5cd4a278efa4a57b7101f0b9023e849f51268da2274d1a188ddff61ad26752dfaadceed2f
@@ -73,18 +73,12 @@ class ::Ish::EmailContext
73
73
  end
74
74
 
75
75
 
76
- field :lead_id
76
+ field :lead_id, type: :integer
77
77
  def lead
78
78
  Lead.find lead_id
79
79
  end
80
- ## @deprecated: use self.lead
81
- field :to_email
82
80
  def to_email
83
- if self[:lead_id]
84
- return lead[:email]
85
- else
86
- return self[:to_email]
87
- end
81
+ return lead[:email]
88
82
  end
89
83
 
90
84
 
@@ -99,3 +93,5 @@ class ::Ish::EmailContext
99
93
  end
100
94
 
101
95
  end
96
+ Ctx = ::Ish::EmailContext
97
+
@@ -33,12 +33,17 @@ class Office::EmailConversation
33
33
 
34
34
  ## Tested manually ok, does not pass the spec. @TODO: hire to make pass spec? _vp_ 2023-03-07
35
35
  def add_tag tag
36
- if WpTag == tag.class
37
- self[:wp_term_ids] = self[:wp_term_ids].push(tag.id).uniq
38
- self.save!
36
+ case tag.class.name
37
+ when 'WpTag'
38
+ ;
39
+ when 'String'
40
+ tag = WpTag.emailtag(tag)
39
41
  else
40
- throw "#add_tag expects a WpTag as the only parameter."
42
+ throw "#add_tag expects a WpTag or string (eg WpTag::EMAILTAG_INBOX) as the only parameter."
41
43
  end
44
+ puts! tag, 'tag'
45
+ self[:wp_term_ids] = ( [ tag.id ] + self[:wp_term_ids] ).uniq
46
+ self.save!
42
47
  end
43
48
 
44
49
  def remove_tag tag
@@ -54,6 +59,11 @@ class Office::EmailConversation
54
59
  ::Office::EmailConversation.where( :wp_term_ids => WpTag.email_inbox_tag.id ).order_by( latest_at: :desc )
55
60
  end
56
61
 
62
+ def self.in_no_trash
63
+ trash_id = WpTag.emailtag('trash').id
64
+ return ::Office::EmailConversation.where( :wp_term_ids.ne => trash_id ).order_by( latest_at: :desc )
65
+ end
66
+
57
67
  def self.in_emailtag which
58
68
  case which.class.name
59
69
  when 'String'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.201
4
+ version: 0.0.33.203
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox