ish_models 0.0.33.198 → 0.0.33.200
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/office/email_conversation.rb +11 -4
- data/lib/office/email_message.rb +0 -23
- data/lib/office/email_message_stub.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c39f66420468113cfb31217b7d1b333b4e6ce7cddb147b416df79d94b9609957
|
4
|
+
data.tar.gz: a4172f8d87117e3a8163e24b44a180c5c8aae0bffadad80e65d12ec8175014a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e65a7d641d83c37c28689f4a16652af4c4b3cfda69361d5392638ed986a6faa96e8b44599ec0864fafebcd65cf02ab44be2f215f957294b02c46e5608b3529c
|
7
|
+
data.tar.gz: 75a064e75948b1befc3f83eefa7defb205a3bac581227a47022c22b04aace3665da751152d87699e52211ca1e2e7f9470e47f7d731296f8d1ed1067bda1fa4cd
|
@@ -17,18 +17,20 @@ class Office::EmailConversation
|
|
17
17
|
Lead.find( lead_ids )
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
def tags
|
22
|
-
WpTag.find( term_ids )
|
23
|
-
end
|
20
|
+
|
24
21
|
|
25
22
|
has_many :email_messages
|
26
23
|
def email_messages
|
27
24
|
Office::EmailMessage.where( email_conversation_id: self.id )
|
28
25
|
end
|
29
26
|
|
27
|
+
def tags
|
28
|
+
WpTag.find( wp_term_ids )
|
29
|
+
end
|
30
|
+
|
30
31
|
## Copied from email_message
|
31
32
|
field :wp_term_ids, type: Array, default: []
|
33
|
+
|
32
34
|
## Tested manually ok, does not pass the spec. @TODO: hire to make pass spec? _vp_ 2023-03-07
|
33
35
|
def add_tag tag
|
34
36
|
if WpTag == tag.class
|
@@ -38,6 +40,7 @@ class Office::EmailConversation
|
|
38
40
|
throw "#add_tag expects a WpTag as the only parameter."
|
39
41
|
end
|
40
42
|
end
|
43
|
+
|
41
44
|
def remove_tag tag
|
42
45
|
if WpTag == tag.class
|
43
46
|
self[:wp_term_ids].delete( tag.id )
|
@@ -47,6 +50,10 @@ class Office::EmailConversation
|
|
47
50
|
end
|
48
51
|
end
|
49
52
|
|
53
|
+
def self.in_inbox
|
54
|
+
::Office::EmailConversation.where( :wp_term_ids => WpTag.email_inbox_tag.id ).order_by( latest_at: :desc )
|
55
|
+
end
|
56
|
+
|
50
57
|
end
|
51
58
|
# EmailConversation = Office::EmailConversation
|
52
59
|
Conv = Office::EmailConversation
|
data/lib/office/email_message.rb
CHANGED
@@ -101,26 +101,3 @@ class Office::EmailMessage
|
|
101
101
|
|
102
102
|
end
|
103
103
|
::Msg = Office::EmailMessage
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
## trash _vp_ 2023-03-07
|
108
|
-
# def process
|
109
|
-
# Aws.config[:credentials] = Aws::Credentials.new(
|
110
|
-
# ::S3_CREDENTIALS[:access_key_id],
|
111
|
-
# ::S3_CREDENTIALS[:secret_access_key]
|
112
|
-
# )
|
113
|
-
# s3 = Aws::S3::Client.new
|
114
|
-
# obj = s3.get_object({
|
115
|
-
# bucket: 'ish-ses',
|
116
|
-
# key: self.object_key
|
117
|
-
# })
|
118
|
-
# obj2 = obj.body.read
|
119
|
-
# mail = Mail.read_from_string( obj2 )
|
120
|
-
# self.from = mail.from
|
121
|
-
# self.to = mail.to
|
122
|
-
# self.subject = mail.subject
|
123
|
-
# self.date = mail.date
|
124
|
-
# self.raw = obj2
|
125
|
-
# self.save
|
126
|
-
# end
|
@@ -17,7 +17,7 @@ class Office::EmailMessageStub
|
|
17
17
|
field :object_path, type: :string ## A routable s3 url ## @TODO: remove this field. _vp_ 2023-03-07
|
18
18
|
# validates_presence_of :object_path ## only need object_key == message_id
|
19
19
|
|
20
|
-
field :
|
20
|
+
field :wp_term_ids, type: :array, default: []
|
21
21
|
|
22
22
|
end
|
23
23
|
Stub = EMS = Office::EmailMessageStub
|