ish_models 0.0.33.206 → 0.0.33.208

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: b8e24861b3b35b37b70e3af96bafba4218230202eb653062ecc5a1ab0a23eb47
4
- data.tar.gz: 1e00c0e839c9eef2bec407c682ded95c1ec542da110959ee74c00a056d6dd862
3
+ metadata.gz: d2b1de33b06b694c8c498fcaf8e9f1be0043cfb671f1320714e161e4a6928b6e
4
+ data.tar.gz: 8ccd99db6e28a9ae30672596f9d237b2f9e8c191d3e9ca61a4e84010fde64071
5
5
  SHA512:
6
- metadata.gz: 28eb24b925e1389526a568d21c449b67db586d2b56e906ed099006d726dc4a5b61fa870dd5c74f7dc7fb31f083a7821fbcf0c24dbb0645940bbff2aa8ab092ab
7
- data.tar.gz: 011e9a1d8ea70590339dbe4a39ecc9769efd57b4b797ee9d542c769926a39bbaeb8493f8914ffe795c05241502bf348ca73e583c4a1dc5d01d450d3cafd802c0
6
+ metadata.gz: 5ea0f2df2d7f9de7ddf355400f511148969dea84974f6f6472e09befdb020e7e5859a5195c6c20dcfe42e67c3b4bb1ed36cd1a0fbb6ca57eb68711d4656d4786
7
+ data.tar.gz: 82460cced11f3de8bcc2963f681c964fbef19fa605ea14a1dd9a5954260d540486a49d7c2fab3227401ff94908953f6438863331b2213c439a3b62001c36a3d7
data/lib/ish_models.rb CHANGED
@@ -8,9 +8,6 @@ require 'kaminari/mongoid'
8
8
 
9
9
  class Gameui; end
10
10
 
11
- module Iro; end
12
-
13
-
14
11
  module Ish; end
15
12
  class Ish::InputError < RuntimeError; end
16
13
 
@@ -54,17 +54,22 @@ class Office::EmailConversation
54
54
  else
55
55
  throw "#remove_tag expects a WpTag or string (eg WpTag::EMAILTAG_INBOX) as the only parameter."
56
56
  end
57
- self[:wp_term_ids].delete( tag.id )
58
- self.save!
59
- end
60
-
61
- def self.in_inbox
62
- ::Office::EmailConversation.where( :wp_term_ids => WpTag.email_inbox_tag.id ).order_by( latest_at: :desc )
57
+ self[:wp_term_ids] = self[:wp_term_ids] - [ tag.id ]
58
+ out = self.save!
59
+ out
63
60
  end
61
+ def rmtag tag; remove_tag tag; end
64
62
 
65
- def self.in_no_trash
66
- trash_id = WpTag.emailtag('trash').id
67
- return ::Office::EmailConversation.where( :wp_term_ids.ne => trash_id ).order_by( latest_at: :desc )
63
+ def self.not_in_emailtag which
64
+ case which.class.name
65
+ when 'String'
66
+ tag_id = WpTag.emailtag(which).id
67
+ when 'WpTag'
68
+ tag_id = which.id
69
+ else
70
+ throw "unsupported in #not_in_emailtag: #{which}"
71
+ end
72
+ return ::Office::EmailConversation.where( :wp_term_ids.ne => tag_id ).order_by( latest_at: :desc )
68
73
  end
69
74
 
70
75
  def self.in_emailtag which
@@ -64,7 +64,7 @@ class Office::EmailMessage
64
64
  email_conversation
65
65
  end
66
66
 
67
- ## @TODO: reimplement, look at footer instead.
67
+ ## @TODO: reimplement
68
68
  def name
69
69
  return 'associate'
70
70
  # from[0].split('@')[0].upcase
@@ -77,23 +77,12 @@ class Office::EmailMessage
77
77
  def apply_filter filter
78
78
  case filter.kind
79
79
  when ::Office::EmailFilter::KIND_SKIP_INBOX
80
- self.remove_tag( ::WpTag.email_inbox_tag )
80
+ self.remove_tag( WpTag::INBOX )
81
81
  when ::Office::EmailFilter::KIND_AUTORESPOND
82
82
  Ish::EmailContext.create({
83
83
  email_template: ::Tmpl.find_by_slug( filter.email_template_slug ),
84
84
  lead: lead,
85
85
  })
86
- # when 'autorespond-remind'
87
- # Office::EmailAction.create({
88
- # tmpl_slug: 'require-sign-nda',
89
- # next_in_days: -> { rand(1..5) },
90
- # next_at_time: ->{ rand(8..16).hours + rand(1..59).minutes },
91
- # next_action: 're-remind-sign-nda',
92
- # })
93
- # Ish::EmailContext.create({
94
- # email_template: ::Tmpl.find_by_slug( filter.email_template_slug ),
95
- # lead: lead,
96
- # })
97
86
  else
98
87
  raise "unknown filter kind: #{filter.kind}"
99
88
  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.206
4
+ version: 0.0.33.208
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox