ish_models 3.1.0.6 → 3.1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- 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: 311e454526047accffea05d6ed3630ac6f9a12596ec4ea9adb8f6523859de410
|
4
|
+
data.tar.gz: 6fffeee07a49484b4589ab4f113464443b132d588490ff1283ff930d2545c0d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7565027390f8d754f8f6e5816f22b69c00d1a1a7ff41895364a7af8c64a77dbb7af0bd9ff775702c0add9feed945972d69cb84b6c41ef118326b723271fd26a4
|
7
|
+
data.tar.gz: 9a821f96be5824bd6cbf2ad01255a2c985417c5984ad6c4283485a76b5f95c9103fc0127f6fad015e56032f347c2f73e3f2049cfa1bede67f98ca4b1845a7646
|
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.7
|
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
|