ish_models 0.0.33.209 → 0.0.33.211

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: a1d881ee26c3ebc1d7ebd70d700f2f2bb48698e1cf0dc3bccaa892f5c66a05d3
4
- data.tar.gz: afb800653429e3c29209199d4da42b566b4a1acf5059e2c03c5d8ae174d06ef2
3
+ metadata.gz: 846b485fb78f382c7d084c59e34ed913434821c725a22fd83ebc1cf13e65e7c0
4
+ data.tar.gz: 5f2a09a0a4671ffe36d0986ecc061de33c1a45188c8c9394fc73a04d3ae00b04
5
5
  SHA512:
6
- metadata.gz: ba5ce659689e9efd867bdd423262afcc4f5a70ab19f5cd1f0d4e6a39a30b3ded49eee02973911d882b6156c265282f103b806a4e6068b5231ec0fad28727c573
7
- data.tar.gz: 7c6745e4f7a230fea262b2f9f99da14dd36872afe1bd6ac16ac93f98a932648ae34dc719e87fbe13f9d2fa9b0327182c755ae845367efb9d7dde32bb2a418802
6
+ metadata.gz: 86344c408514561160296d4b4fc6a3647da3f85028fc3ac41cb9c03d7a7271ea2a4984c8875a9dda412d1306be1d6ffb5a960ce5f2e5a35e7b3259444c4704e6
7
+ data.tar.gz: aff1681e76aa26eb7d322ebe8988da180b6b20fa42c68c40b235b1ed45957b762f95a31969dfc3b00985c93eff267833415b75a92f06c849442aa7118bc44929
@@ -41,23 +41,34 @@ class Office::EmailMessage
41
41
 
42
42
  ## Copied to email_conversation
43
43
  field :wp_term_ids, type: Array, default: []
44
+
44
45
  ## Tested manually ok, does not pass the spec. @TODO: hire to make pass spec? _vp_ 2023-03-07
45
46
  def add_tag tag
46
- if WpTag == tag.class
47
- self[:wp_term_ids] = self[:wp_term_ids].push(tag.id).uniq
48
- self.save!
47
+ case tag.class.name
48
+ when 'WpTag'
49
+ ;
50
+ when 'String'
51
+ tag = WpTag.emailtag(tag)
49
52
  else
50
- throw "#add_tag expects a WpTag as the only parameter."
53
+ throw "#add_tag2 expects a WpTag or string (eg WpTag::INBOX) as the only parameter."
51
54
  end
55
+ self[:wp_term_ids] = ( [ tag.id ] + self[:wp_term_ids] ).uniq
56
+ self.save!
52
57
  end
53
58
  def remove_tag tag
54
- if WpTag == tag.class
55
- self[:wp_term_ids].delete( tag.id )
56
- self.save!
59
+ case tag.class.name
60
+ when 'WpTag'
61
+ ;
62
+ when 'String'
63
+ tag = WpTag.emailtag(tag)
57
64
  else
58
- throw "#remove_tag expects a WpTag as the only parameter."
65
+ throw "#remove_tag2 expects a WpTag or string (eg WpTag::INBOX) as the only parameter."
59
66
  end
67
+ self[:wp_term_ids] = self[:wp_term_ids] - [ tag.id ]
68
+ out = self.save!
69
+ out
60
70
  end
71
+ def rmtag tag; remove_tag tag; end
61
72
 
62
73
  belongs_to :email_conversation
63
74
  def conv
@@ -74,10 +85,12 @@ class Office::EmailMessage
74
85
  from[0].split('@')[1]
75
86
  end
76
87
 
88
+ ## @TODO: move to email_conversation _vp_ 2023-03-24
77
89
  def apply_filter filter
78
90
  case filter.kind
79
91
  when ::Office::EmailFilter::KIND_SKIP_INBOX
80
92
  self.remove_tag( WpTag::INBOX )
93
+ self.conv.remove_tag( WpTag::INBOX )
81
94
  when ::Office::EmailFilter::KIND_AUTORESPOND
82
95
  Ish::EmailContext.create({
83
96
  email_template: ::Tmpl.find_by_slug( filter.email_template_slug ),
data/lib/video.rb CHANGED
@@ -16,6 +16,7 @@ class Video
16
16
 
17
17
  field :name, :type => String
18
18
  field :descr, :type => String, :as => :description
19
+ field :subhead ## still need it... 2023-03-24
19
20
 
20
21
  field :is_trash, :type => Boolean, :default => false
21
22
  def is_trash
@@ -93,7 +94,7 @@ end
93
94
 
94
95
  =begin
95
96
  field :issue
96
- field :subhead
97
+
97
98
  field :is_feature, :type => Boolean, :default => false
98
99
  field :lang, :type => String, :default => 'en'
99
100
  =end
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.209
4
+ version: 0.0.33.211
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox