wco_models 3.1.0.49 → 3.1.0.50

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59ffec6c4c869d7be3284372fee1f1fd256be7be9d91aab789de5a3a16d5341e
4
- data.tar.gz: ecff78bf5d5cfd33376287ccf3dff091b098879f592c3c88aa41d6104edddfa8
3
+ metadata.gz: 1a17b1b5e607a9bd18dd6f5b6f6b4346e8af8b25460bc07a622fd7c54d1cf928
4
+ data.tar.gz: c5974d04bbac542b413cf6d444694e5e319271c27a4a399accd8c811a2609166
5
5
  SHA512:
6
- metadata.gz: a8a84b80a2f8388394c496423fbc35c7eb05bd0f1d67172266ddeb429cfb37e147d496fe5e9370741766ccfbf0dd3d04bf0e2f43c6fb7485e63b67ef25da802d
7
- data.tar.gz: ab9b15349faffb29f3bcfc011ce4c75c7c73c418d04239d872cf9bedc29eea51b5a76166ac9924e901449da48e12ad5f27e6a7cfc411efd28dc0cf41deb8009f
6
+ metadata.gz: f8645a7db623d91cafd9f3a828e2e9ceabea87dcbefecdadfe21cddd74f51cbad6622535466179e9d004b9201d5f89a11157ceeb629bc551def8ea450045fbe2
7
+ data.tar.gz: 538e2e1e434bd37a7995f8b51b573f424aa76eb483cc196eb34d3c0dc89f18346f238ebbea244c586db976c8cfdf33be1ae6946a6b69aa6fa3f3b7c45bf7eacb
@@ -16,6 +16,8 @@ class Wco::Lead
16
16
  belongs_to :leadset, class_name: 'Wco::Leadset'
17
17
  has_one :photo, class_name: 'Wco::Photo'
18
18
 
19
+ has_many :email_messages, class_name: '::WcoEmail::Message', inverse_of: :lead
20
+
19
21
  has_and_belongs_to_many :conversations, class_name: '::WcoEmail::Conversation'
20
22
  def convs; conversations; end
21
23
  has_many :email_contexts, class_name: '::WcoEmail::Context'
@@ -1,7 +1,7 @@
1
+
1
2
  ##
2
3
  ## Send a single email
3
4
  ##
4
-
5
5
  class WcoEmail::Context
6
6
  include Mongoid::Document
7
7
  include Mongoid::Timestamps
@@ -45,6 +45,8 @@ class WcoEmail::Context
45
45
  self[:subject].presence || tmpl.subject
46
46
  end
47
47
 
48
+ belongs_to :reply_to_message, class_name: 'WcoEmail::Message', inverse_of: :replies, optional: true
49
+
48
50
  belongs_to :email_template, class_name: 'WcoEmail::EmailTemplate'
49
51
  def tmpl; email_template; end
50
52
 
@@ -106,10 +106,10 @@ class WcoEmail::EmailTemplate
106
106
  binding()
107
107
  end
108
108
 
109
- has_many :email_actions, class_name: 'WcoEmail::EmailAction'
110
- has_many :email_contexts, class_name: 'WcoEmail::EmailContext'
111
- has_many :email_filters, class_name: 'WcoEmail::EmailFilter'
112
- has_many :unsubscribes, class_name: 'WcoEmail::Unsubscribe'
109
+ has_many :email_actions, class_name: '::WcoEmail::EmailAction'
110
+ has_many :email_contexts, class_name: '::WcoEmail::Context'
111
+ has_many :email_filters, class_name: '::WcoEmail::EmailFilter'
112
+ has_many :unsubscribes, class_name: '::WcoEmail::Unsubscribe'
113
113
 
114
114
  SLUG_BLANK = 'blank'
115
115
  def self.blank_template
@@ -49,6 +49,8 @@ class WcoEmail::Message
49
49
 
50
50
  field :from, type: :string
51
51
  field :froms, type: Array, default: []
52
+ belongs_to :lead, class_name: 'Wco::Lead', inverse_of: :email_messages
53
+
52
54
  field :to, type: :string
53
55
  field :tos, type: Array, default: []
54
56
  field :cc, type: :string
@@ -69,6 +71,7 @@ class WcoEmail::Message
69
71
 
70
72
  has_many :assets, class_name: '::Wco::Asset'
71
73
  has_many :photos, class_name: '::Wco::Photo'
74
+ has_many :replies, class_name: '::WcoEmail::Context', inverse_of: :reply_to_message
72
75
 
73
76
  def apply_filter filter
74
77
  case filter.kind
data/lib/wco_models.rb CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'aws-sdk-s3'
3
3
 
4
+ require 'business_time'
5
+
4
6
  require 'cancancan'
5
7
 
6
8
  require 'devise'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.49
4
+ version: 3.1.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3