ish_models 3.1.0.6 → 3.1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ish_models.rb +1 -0
- data/lib/wco_email/email_filter.rb +45 -0
- metadata +2 -4
- data/lib/ish_models/engine.rb +0 -5
- data/lib/ish_models/version.rb-trash +0 -3
- data/lib/wco_email/ability.rb-trash +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82702b99ffbf02fbc5939e3987c8c6432bdc3de0dac93aaddfaedc746cc7bab
|
4
|
+
data.tar.gz: 123e4b8b0b19aee05d4314e6d97a5ae5e53c4b34ca61d6b503aa81314f0a4686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c14590af447bb6f25e566da3fbd5d33fc40a65ed8ff670759da4b4a4183b3d3de5d32412c8e568c5385ec99b17bef03aac3631811fbd7bae419fd7f6e5bb5b35
|
7
|
+
data.tar.gz: f6a632131610cad2ecb7efab26bd91d5e5958c09e7114b0f116e7a7feeb3f408b44ebb0763ef224a5067d1ab9a3deef7520821adcc16dc58683bb985007bd32f
|
data/lib/ish_models.rb
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
##
|
3
|
+
## 2023-03-04 _vp_ When I receive one.
|
4
|
+
##
|
5
|
+
class WcoEmail::EmailFilter
|
6
|
+
include Mongoid::Document
|
7
|
+
include Mongoid::Timestamps
|
8
|
+
|
9
|
+
field :from_regex
|
10
|
+
field :from_exact
|
11
|
+
field :subject_regex
|
12
|
+
field :subject_exact
|
13
|
+
field :body_regex
|
14
|
+
field :body_exact
|
15
|
+
|
16
|
+
|
17
|
+
KIND_AUTORESPOND_TMPL = 'autorespond-template'
|
18
|
+
KIND_AUTORESPOND_EACT = 'autorespond-email-action'
|
19
|
+
KIND_REMOVE_TAG = 'remove-tag'
|
20
|
+
KIND_ADD_TAG = 'add-tag'
|
21
|
+
KIND_DESTROY_SCHS = 'destroy-schs'
|
22
|
+
|
23
|
+
KIND_AUTORESPOND = 'autorespond' # @deprecated, DO NOT USE!
|
24
|
+
KIND_DELETE = 'delete' # @deprecated, use add-tag
|
25
|
+
KIND_SKIP_INBOX = 'skip-inbox' # @deprecated, use remove-tag
|
26
|
+
|
27
|
+
KINDS = [ nil, KIND_AUTORESPOND_TMPL, KIND_AUTORESPOND_EACT, KIND_ADD_TAG, KIND_REMOVE_TAG, KIND_DESTROY_SCHS]
|
28
|
+
field :kind
|
29
|
+
|
30
|
+
STATE_ACTIVE = 'active'
|
31
|
+
STATE_INACTIVE = 'inactive'
|
32
|
+
STATES = [ STATE_ACTIVE, STATE_INACTIVE ]
|
33
|
+
field :state, type: :string, default: STATE_ACTIVE
|
34
|
+
scope :active, ->{ where( state: STATE_ACTIVE ) }
|
35
|
+
|
36
|
+
belongs_to :email_template, class_name: 'Ish::EmailTemplate', optional: true
|
37
|
+
belongs_to :email_action, class_name: 'Office::EmailAction', optional: true
|
38
|
+
|
39
|
+
field :wp_term_id, type: :integer
|
40
|
+
def category
|
41
|
+
self.wp_term_id && WpTag.find( self.wp_term_id )
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
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: 3.1.0.
|
4
|
+
version: 3.1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mac_a2141
|
@@ -140,14 +140,12 @@ files:
|
|
140
140
|
- app/views/layouts/ish_models/application.html.erb
|
141
141
|
- config/routes.rb
|
142
142
|
- lib/ish_models.rb
|
143
|
-
- lib/ish_models/engine.rb
|
144
|
-
- lib/ish_models/version.rb-trash
|
145
143
|
- lib/tasks/ish_models_tasks.rake
|
146
144
|
- lib/wco/leadset.rb
|
147
145
|
- lib/wco/profile.rb
|
148
146
|
- lib/wco/tag.rb
|
149
|
-
- lib/wco_email/ability.rb-trash
|
150
147
|
- lib/wco_email/conversation.rb
|
148
|
+
- lib/wco_email/email_filter.rb
|
151
149
|
- lib/wco_email/message_template.rb
|
152
150
|
- lib/wco_email/tag.rb-trash
|
153
151
|
- lib/wco_hosting/appliance.rb
|
data/lib/ish_models/engine.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'cancancan'
|
4
|
-
|
5
|
-
class WcoEmail::Ability
|
6
|
-
include ::CanCan::Ability
|
7
|
-
|
8
|
-
def initialize(user)
|
9
|
-
|
10
|
-
if user
|
11
|
-
|
12
|
-
if [ 'piousbox@gmail.com', 'victor@piousbox.com', 'victor@wasya.co' ].include? user.email
|
13
|
-
can :manage, :all
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
# Define abilities for the user here. For example:
|
19
|
-
#
|
20
|
-
# return unless user.present?
|
21
|
-
# can :read, :all
|
22
|
-
# return unless user.admin?
|
23
|
-
# can :manage, :all
|
24
|
-
#
|
25
|
-
# The first argument to `can` is the action you are giving the user
|
26
|
-
# permission to do.
|
27
|
-
# If you pass :manage it will apply to every action. Other common actions
|
28
|
-
# here are :read, :create, :update and :destroy.
|
29
|
-
#
|
30
|
-
# The second argument is the resource the user can perform the action on.
|
31
|
-
# If you pass :all it will apply to every resource. Otherwise pass a Ruby
|
32
|
-
# class of the resource.
|
33
|
-
#
|
34
|
-
# The third argument is an optional hash of conditions to further filter the
|
35
|
-
# objects.
|
36
|
-
# For example, here the user can only update published articles.
|
37
|
-
#
|
38
|
-
# can :update, Article, published: true
|
39
|
-
#
|
40
|
-
# See the wiki for details:
|
41
|
-
# https://github.com/CanCanCommunity/cancancan/blob/develop/docs/define_check_abilities.md
|
42
|
-
end
|
43
|
-
end
|