wco_models 3.1.0.45 → 3.1.0.46

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: 6eca81149b751af67bdaeaf83369e10a053f8df727a62cae6491a9bd6d7033b0
4
- data.tar.gz: 073553f8ad6ca654445d4bc1685ed5c4ebd6d9deabe38494b486c28573e35cef
3
+ metadata.gz: 0a5d5670d27e5ffe31a148d7c746b5da9ab488cbe69dc6858d3ea5dd30bba67a
4
+ data.tar.gz: 301c1ed8eab2e77f157a5b7560dbfcb6d2e23b45b6dc64b469b5de2c0d75e5df
5
5
  SHA512:
6
- metadata.gz: 1fe3104f7484a1ea45f73dd3ae6d8bf01a6ea135747698163768832c5b916d3e17ce930538e9eb9e4b9139911a5d18d3d17790d9291faae73434d9dd88060306
7
- data.tar.gz: 8993d0f1294ee42d0c1a90a065f287fed3ee373fdb1417bc41256231da63301e6f2369e5b2e1fc8a895c2fb6690113b7136e3e5e3730c377470d5c62986afa30
6
+ metadata.gz: 254d577ba591a0fa571637f7530608cee0993ec36095669e4eae89d672c463ee53c30a4e9d03333b456aef8b267d91edd348ccbac7695db05c681d157dc140e8
7
+ data.tar.gz: b4ac32502cf0456b89281681a704dc9bbc91fc92807b7f5c5844acbdfc2f3f7b5a0d8f0901670c260adf174c6e8ed7e6d161f758b3b18dcbd5c161c4fd401955
@@ -30,7 +30,7 @@ class Wco::Lead
30
30
  # has_many :videos, class_name: 'Wco::Video'
31
31
 
32
32
  def self.list
33
- all.map { |p| [ p.id, p.email ] }
33
+ [[nil,nil]] + all.map { |p| [ p.email, p.id ] }
34
34
  end
35
35
 
36
36
  OP_DELETE = 'delete'
@@ -1,4 +1,6 @@
1
1
 
2
+ require 'mongoid_paperclip'
3
+
2
4
  class Wco::Video
3
5
  include Mongoid::Document
4
6
  include Mongoid::Timestamps
@@ -12,7 +14,6 @@ class Wco::Video
12
14
  field :subhead ## still need it... 2023-03-24
13
15
 
14
16
  field :is_public, :type => Boolean, :default => false
15
-
16
17
  def published
17
18
  where({ :is_public => true }).order_by({ :created_at => :desc })
18
19
  end
@@ -28,13 +29,6 @@ class Wco::Video
28
29
  # belongs_to :user_profile, :class_name => 'Ish::UserProfile', :inverse_of => :videos
29
30
  # has_and_belongs_to_many :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_videos
30
31
 
31
-
32
- def self.list
33
- [['', nil]] + self.unscoped.order_by( :created_at => :desc ).map do |item|
34
- [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ]
35
- end
36
- end
37
-
38
32
  has_mongoid_attached_file :video,
39
33
  # styles: { :thumb => { geometry: '192x108', format: 'jpeg' }, },
40
34
  # processors: [ :transcoder ],
@@ -69,4 +63,10 @@ class Wco::Video
69
63
  %w| name descr |
70
64
  end
71
65
 
66
+ def self.list
67
+ [['', nil]] + self.unscoped.order_by( :created_at => :desc ).map do |item|
68
+ [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ]
69
+ end
70
+ end
71
+
72
72
  end
@@ -45,8 +45,6 @@ class WcoEmail::Context
45
45
  self[:subject].presence || tmpl.subject
46
46
  end
47
47
 
48
- has_and_belongs_to_many :leads, class_name: 'Wco::Lead'
49
-
50
48
  belongs_to :email_template, class_name: 'WcoEmail::EmailTemplate'
51
49
  def tmpl; email_template; end
52
50
 
@@ -76,6 +74,9 @@ class WcoEmail::Context
76
74
 
77
75
 
78
76
  belongs_to :lead, class_name: 'Wco::Lead'
77
+ def to_email
78
+ lead.email
79
+ end
79
80
 
80
81
  field :cc, type: :string
81
82
  field :ccs, type: :array, default: []
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.45
4
+ version: 3.1.0.46
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-07 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3