ish_models 3.1.0.6 → 3.1.0.8

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: c82702b99ffbf02fbc5939e3987c8c6432bdc3de0dac93aaddfaedc746cc7bab
4
+ data.tar.gz: 123e4b8b0b19aee05d4314e6d97a5ae5e53c4b34ca61d6b503aa81314f0a4686
5
5
  SHA512:
6
- metadata.gz: d7472f45bceb194872bd369b0dd6c5fd1c29ceb35a6d8dbeaccd99bd5c0c0ad59847bef1b79f29ac20abe790c00925cf0fe77dca1a118b892ec9ebdc416cf876
7
- data.tar.gz: 4702a3f0c1a8962f7ebbf9a2a6d7a4fbdf4a64339dd5092a88edf4523a552c87bc9caa672b727f6feae7a791adb7baa19981bcda0c47e2798e1395ef98a559ca
6
+ metadata.gz: c14590af447bb6f25e566da3fbd5d33fc40a65ed8ff670759da4b4a4183b3d3de5d32412c8e568c5385ec99b17bef03aac3631811fbd7bae419fd7f6e5bb5b35
7
+ data.tar.gz: f6a632131610cad2ecb7efab26bd91d5e5958c09e7114b0f116e7a7feeb3f408b44ebb0763ef224a5067d1ab9a3deef7520821adcc16dc58683bb985007bd32f
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.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
@@ -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