wco_models 3.1.0.153 → 3.1.0.154

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: d25598a6db9204889720f02b371b8e1d206724f49af7dbbf6122f15973d00a8a
4
- data.tar.gz: e5b36788322711cbbd54463d38d9dd3e45684c4679002048784a7f3d3768d106
3
+ metadata.gz: 8214f97a78a923e7696ac257e51c35e82735e5f49ee72fb5323897c263494eed
4
+ data.tar.gz: 50a95c9ae5bc39baf0f5ed8c959b537219e6646accffd52f46577941c393835e
5
5
  SHA512:
6
- metadata.gz: cb1ca289cc7a97e4f423d5c6928e162bd471d00a8c18f2d2061ed8a6fb387a31c23c383a64762cbf007120162c822a8554468dcc2fab2c70dcd17f8f46a693da
7
- data.tar.gz: be52e2c4133a04e9fb9af78921cf5548b287c0ef917bafeae90fa9948654cddc293f6145a2260add440675bac78ec5864485ab2e3778a0f3d2af0d19058deb98
6
+ metadata.gz: 2ee8c67d727e601dbf625f4309651d56611f147852e50091bb0f8144b4b25aa382a88268fce8475a975157a9fd01e97d8bc7bdc06c980dd02084fe47eb6683c9
7
+ data.tar.gz: 7356863e168fc520d0dd7ba14a9a4e02bd4b77b97b92a00df164569f0136162446a843189495fde59eac51d804cae0a93adccfc99b2a292aca8c6af579cb3bc1
@@ -1,14 +1,15 @@
1
1
 
2
- EC ||= WcoEmail::Conversation
3
- EF ||= WcoEmail::EmailFilter
4
- EM ||= WcoEmail::Message
5
- ET ||= WcoEmail::EmailTemplate
6
- MS ||= WcoEmail::MessageStub
7
- EMS ||= MS
8
- OA ||= Wco::OfficeAction
9
- OAT ||= Wco::OfficeActionTemplate
10
- OATT ||= Wco::OfficeActionTemplateTie
11
- Sch ||= WcoEmail::EmailAction
2
+ require_relative '../../../lib/shortcuts'
3
+ # EC ||= WcoEmail::Conversation
4
+ # EF ||= WcoEmail::EmailFilter
5
+ # EM ||= WcoEmail::Message
6
+ # ET ||= WcoEmail::EmailTemplate
7
+ # MS ||= WcoEmail::MessageStub
8
+ # EMS ||= MS
9
+ # OA ||= Wco::OfficeAction
10
+ # OAT ||= Wco::OfficeActionTemplate
11
+ # OATT ||= Wco::OfficeActionTemplateTie
12
+ # Sch ||= WcoEmail::EmailAction
12
13
 
13
14
  class Wco::ApplicationController < ActionController::Base
14
15
  include Wco::ApplicationHelper
@@ -8,6 +8,7 @@ class Wco::ReportsController < Wco::ApplicationController
8
8
 
9
9
  @report = Wco::Report.new params[:report].permit!
10
10
  authorize! :create, @report
11
+ @report.author = current_profile
11
12
  if @report.save
12
13
  flash_notice "created report"
13
14
  else
@@ -26,6 +26,10 @@ class Wco::Profile
26
26
  [nil] + ROLES
27
27
  end
28
28
 
29
+ def self.ai_writer
30
+ find_or_create_by email: 'ai-writer@wasya.co'
31
+ end
32
+
29
33
  def to_s
30
34
  email
31
35
  end
@@ -70,7 +70,7 @@ class WcoEmail::Message
70
70
  field :date, type: DateTime
71
71
  def received_at ; date ; end
72
72
 
73
- belongs_to :conversation, class_name: 'WcoEmail::Conversation'
73
+ belongs_to :conversation, class_name: 'WcoEmail::Conversation', index: true
74
74
  def conv ; conversation ; end
75
75
 
76
76
  belongs_to :stub, class_name: 'WcoEmail::MessageStub'
@@ -80,7 +80,7 @@ class WcoEmail::Message
80
80
  has_many :replies, class_name: '::WcoEmail::Context', inverse_of: :reply_to_message
81
81
 
82
82
  def apply_filter filter
83
- puts! filter, 'WcoEmail::Message#apply_filter'
83
+ puts! filter, 'WcoEmail::Message#apply_filter' if DEBUG
84
84
  conv.filter = filter
85
85
 
86
86
  case filter.kind
@@ -118,7 +118,7 @@ class WcoEmail::MessageStub
118
118
  cc: the_mail.cc ? the_mail.cc[0] : nil,
119
119
  ccs: the_mail.cc,
120
120
  })
121
- puts! @message, '@message'
121
+ # puts! @message, '@message'
122
122
 
123
123
  ## Parts
124
124
  the_mail.parts.each do |part|
@@ -30,7 +30,7 @@ class WcoHosting::Appliance
30
30
  end
31
31
 
32
32
  field :subdomain
33
- belongs_to :domain, class_name: 'WcoHosting::Domain'
33
+ belongs_to :domain, class_name: 'WcoHosting::Domain', optional: true
34
34
  def host
35
35
  "#{subdomain}.#{domain.name}"
36
36
  end
@@ -49,7 +49,7 @@
49
49
  .col-md-6.schs
50
50
  %h5
51
51
  Email Actions (#{@lead.schs.length})
52
- = link_to '[+]', wco_email.new_email_action_path(lead_id: @lead.id)
52
+ = link_to '[+]', wco_email.new_email_action_path(lead_id: @lead.id) if defined?(wco_email)
53
53
  %ul
54
54
  - @lead.schs.each do |sch|
55
55
  %li
data/lib/shortcuts.rb ADDED
@@ -0,0 +1,11 @@
1
+
2
+ EC ||= WcoEmail::Conversation
3
+ EF ||= WcoEmail::EmailFilter
4
+ EM ||= WcoEmail::Message
5
+ ET ||= WcoEmail::EmailTemplate
6
+ MS ||= WcoEmail::MessageStub
7
+ EMS ||= MS
8
+ OA ||= Wco::OfficeAction
9
+ OAT ||= Wco::OfficeActionTemplate
10
+ OATT ||= Wco::OfficeActionTemplateTie
11
+ Sch ||= WcoEmail::EmailAction
data/lib/wco/ai_writer.rb CHANGED
@@ -45,6 +45,7 @@ class Wco::AiWriter
45
45
  title: new_title,
46
46
  # slug: new_title,
47
47
  body: new_body,
48
+ author: Wco::Profile.ai_writer,
48
49
  })
49
50
 
50
51
  return report
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.153
4
+ version: 3.1.0.154
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-11 00:00:00.000000000 Z
11
+ date: 2024-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -662,6 +662,7 @@ files:
662
662
  - app/views/wco_hosting/scripts/nginx_site.conf.erb
663
663
  - config/initializers/assets.rb
664
664
  - config/routes.rb
665
+ - lib/shortcuts.rb
665
666
  - lib/tasks/db_tasks.rake
666
667
  - lib/tasks/office_tasks.rake
667
668
  - lib/tasks/wp_tasks.rake