wco_models 3.1.0.195 → 3.1.0.197

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c22cf3c0d0ec7da173c5d3fc82139b5162ce9cc8f6016e962d409ac767e3a73b
4
- data.tar.gz: 30606ba3abb75fc7ff474e6f7bfdccc76894bf98e65d33e07fc95316fe36bb4b
3
+ metadata.gz: df847f3f11917d96587bce5d3b58018c27215956a43a7bf44a34a04966f750b6
4
+ data.tar.gz: 0c88c176cd9befa80e849bf60b6e69b2d49e79da37fd8377f07a74b1f7a22010
5
5
  SHA512:
6
- metadata.gz: c6ba50af11cf4290e53d868f5eed7d9e83e965d686d19f2be0c7913a3b38b73e277530bd23ed329121d2e44cdf6f2c711909e893f9dcdef6cdc8d2f24ff1cfe1
7
- data.tar.gz: e2b85387f378afc6a981832db68154560de4d60330aeb1f333e60c20a351287ca7749ca8788497a3048dc0880c50e66018d75a00ef7b3470ba8d2a334786a3ae
6
+ metadata.gz: bd47844f69a043b3cd9ed19db47c8ca52db44568788e4bfefdd14c66d31bdce1f6cd0ea66bc3a526d1bb546d75f50cf35a586ebba25542e94f5d8dfee4239885
7
+ data.tar.gz: 3a7e32b323db4f08da4b355c9602206c6c2f3a196683f2ef41ca5e274cd5159f17b79fa702981d59d49857a332d733f8d05c2cd227f15c6326f0da8d4c6fb411
@@ -7,6 +7,7 @@ class Wco::Gallery
7
7
  include Wco::Utils
8
8
  store_in collection: 'galleries'
9
9
 
10
+ PAGE_PARAM_NAME = 'galleries_page'
10
11
 
11
12
  field :name
12
13
  validates :name, :uniqueness => true
@@ -6,6 +6,8 @@ class Wco::Headline
6
6
  include Mongoid::Paranoia
7
7
  store_in collection: 'wco_content_headlines'
8
8
 
9
+ PAGE_PARAM_NAME = 'headlines_page'
10
+
9
11
  field :date
10
12
  validates :date, presence: true
11
13
 
@@ -5,6 +5,8 @@ class Wco::Lead
5
5
  include Mongoid::Paranoia
6
6
  store_in collection: 'wco_leads'
7
7
 
8
+ PAGE_PARAM_NAME = 'leads_page'
9
+
8
10
  field :email
9
11
  validates :email, presence: true, uniqueness: true
10
12
  index({ email: -1 }, { unique: true })
@@ -5,6 +5,8 @@ class Wco::Leadset
5
5
  include Mongoid::Paranoia
6
6
  store_in collection: 'wco_leadsets'
7
7
 
8
+ PAGE_PARAM_NAME = 'leadsets_page'
9
+
8
10
  field :company_url
9
11
  validates :company_url, presence: true, uniqueness: true
10
12
  index({ company_url: 1 }, { unique: true, name: 'company_url' })
@@ -9,6 +9,8 @@ class Wco::Report
9
9
  include Wco::Utils
10
10
  store_in collection: 'wco_reports'
11
11
 
12
+ PAGE_PARAM_NAME = 'reports_page'
13
+
12
14
  field :title
13
15
  validates :title, presence: true # , uniqueness: true
14
16
  index({ title: 1 }, { unique: true })
@@ -9,6 +9,8 @@ class Wco::Video
9
9
  include Wco::Utils
10
10
  store_in collection: 'videos'
11
11
 
12
+ PAGE_PARAM_NAME = 'videos_page'
13
+
12
14
  field :name, :type => String
13
15
  index({ created_at: -1 })
14
16
  index({ created_at: -1, name: -1 })
@@ -5,6 +5,8 @@ class WcoEmail::Conversation
5
5
  include Mongoid::Paranoia
6
6
  store_in collection: 'office_email_conversations'
7
7
 
8
+ PAGE_PARAM_NAME = 'conversations_page'
9
+
8
10
  STATUS_UNREAD = 'status_unread'
9
11
  STATUS_READ = 'status_read'
10
12
  STATUSES = [ STATUS_UNREAD, STATUS_READ ]
@@ -23,7 +23,7 @@ class WcoEmail::EmailFilter
23
23
 
24
24
  has_many :actions, class_name: '::WcoEmail::EmailFilterAction', inverse_of: :email_filter
25
25
  accepts_nested_attributes_for :actions, allow_destroy: true
26
- validate :validate_actions
26
+ # validate :validate_actions
27
27
  def validate_actions
28
28
  if actions.length == 0
29
29
  errors.add(:actions, 'must be present')
@@ -38,7 +38,7 @@ class WcoEmail::EmailFilter
38
38
  has_many :skip_conditions, class_name: '::WcoEmail::EmailFilterCondition', inverse_of: :email_skip_filter
39
39
  accepts_nested_attributes_for :skip_conditions, allow_destroy: true
40
40
 
41
- validate :validate_conditions
41
+ # validate :validate_conditions
42
42
  def validate_conditions
43
43
  if conditions.length + skip_conditions.length == 0
44
44
  errors.add(:conditions, 'Either conditions or skip conditions must be present.')
@@ -16,6 +16,8 @@ class WcoEmail::MessageStub
16
16
  include Mongoid::Paranoia
17
17
  store_in collection: 'wco_email_message_stub'
18
18
 
19
+ PAGE_PARAM_NAME = 'stubs_page'
20
+
19
21
  STATUS_PENDING = 'status_pending'
20
22
  STATUS_PROCESSED = 'status_processed'
21
23
  STATUS_FAILED = 'status_failed'
@@ -9,25 +9,25 @@
9
9
  <b>Conversations (#{@tag.conversations.length}):&nbsp;</b>
10
10
  - if @tag.conversations.present?
11
11
  .Conversations
12
- = render '/wco_email/conversations/table', convs: @tag.conversations
12
+ = render '/wco_email/conversations/table', convs: @tag.conversations.page( params[::WcoEmail::Conversation::PAGE_PARAM_NAME] )
13
13
  %li.d-flex
14
14
  <b>Message Stubs (#{@tag.message_stubs.length}):&nbsp;</b>
15
- = render '/wco_email/message_stubs/index', stubs: @tag.message_stubs.page( params[:stubs_page] )
15
+ = render '/wco_email/message_stubs/index', stubs: @tag.message_stubs.page( params[::WcoEmail::MessageStub::PAGE_PARAM_NAME] )
16
16
 
17
17
  %li.d-flex
18
18
  <b>Galleries (#{@galleries.length}):&nbsp;</b>
19
- = render '/wco/galleries/index', galleries: @galleries, config: { skip_tags: true }
19
+ = render '/wco/galleries/index', galleries: @galleries.page( params[::Wco::Gallery::PAGE_PARAM_NAME] ), config: { skip_tags: true }
20
20
  %li.d-flex
21
21
  <b>Headlines (#{@tag.headlines.length}):&nbsp;</b>
22
- = render '/wco/headlines/index', headlines: @tag.headlines
22
+ = render '/wco/headlines/index', headlines: @tag.headlines.page( params[::Wco::Headline::PAGE_PARAM_NAME] )
23
23
 
24
24
  %li.d-flex
25
25
  <b>Leadsets (#{@tag.leadsets.length}):&nbsp;</b>
26
- = render '/wco/leadsets/index_list', leadsets: @tag.leadsets
26
+ = render '/wco/leadsets/index_list', leadsets: @tag.leadsets.page( params[::Wco::Leadset::PAGE_PARAM_NAME] )
27
27
  %li.d-flex
28
28
  <b>Leads (#{@tag.leads.length}):&nbsp;</b>
29
- = render '/wco/leads/index', leads: @tag.leads
29
+ = render '/wco/leads/index', leads: @tag.leads.page( params[::Wco::Lead::PAGE_PARAM_NAME] )
30
30
 
31
31
  %li.d-flex
32
32
  <b>Reports (#{@reports.length}):&nbsp;</b>
33
- = render '/wco/reports/index', reports: @reports, config: { skip_tags: true }
33
+ = render '/wco/reports/index', reports: @reports.page( params[::Wco::Report::PAGE_PARAM_NAME] ), config: { skip_tags: true }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.195
4
+ version: 3.1.0.197
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev