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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79b866df45b1f836996eae873bb73bdad131d78fc60d35e1dbf09918792dc73c
4
- data.tar.gz: 1a094e1696284dd4c74dcca8b2e8abd5d1abfe3722e7a20d3d69b5e593a48494
3
+ metadata.gz: 311e454526047accffea05d6ed3630ac6f9a12596ec4ea9adb8f6523859de410
4
+ data.tar.gz: 6fffeee07a49484b4589ab4f113464443b132d588490ff1283ff930d2545c0d9
5
5
  SHA512:
6
- metadata.gz: d7472f45bceb194872bd369b0dd6c5fd1c29ceb35a6d8dbeaccd99bd5c0c0ad59847bef1b79f29ac20abe790c00925cf0fe77dca1a118b892ec9ebdc416cf876
7
- data.tar.gz: 4702a3f0c1a8962f7ebbf9a2a6d7a4fbdf4a64339dd5092a88edf4523a552c87bc9caa672b727f6feae7a791adb7baa19981bcda0c47e2798e1395ef98a559ca
6
+ metadata.gz: 7565027390f8d754f8f6e5816f22b69c00d1a1a7ff41895364a7af8c64a77dbb7af0bd9ff775702c0add9feed945972d69cb84b6c41ef118326b723271fd26a4
7
+ data.tar.gz: 9a821f96be5824bd6cbf2ad01255a2c985417c5984ad6c4283485a76b5f95c9103fc0127f6fad015e56032f347c2f73e3f2049cfa1bede67f98ca4b1845a7646
data/lib/ish_models.rb CHANGED
@@ -13,6 +13,7 @@ require 'wco/profile'
13
13
  require 'wco/tag'
14
14
 
15
15
  require 'wco_email/conversation'
16
+ require 'wco_email/email_filter'
16
17
  require 'wco_email/message_template'
17
18
 
18
19
  require 'wco_hosting/appliance'
@@ -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.6
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
@@ -1,5 +0,0 @@
1
- module IshModels
2
- class Engine < ::Rails::Engine
3
- isolate_namespace IshModels
4
- end
5
- end
@@ -1,3 +0,0 @@
1
- module IshModels
2
- VERSION = File.read 'VERSION'
3
- end
@@ -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