workarea-api 4.5.5 → 4.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/Rakefile +7 -7
- data/admin/app/models/workarea/api/admin/date_filtering.rb +0 -3
- data/admin/lib/workarea/api/admin.rb +1 -0
- data/admin/lib/workarea/api/admin/date_indexes.rb +23 -0
- data/admin/lib/workarea/api/admin/engine.rb +2 -0
- data/lib/workarea/api/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23e26db12c8a362c10c2566b015167cceccbf9b7dcac7e4c5c955b6773debb45
|
4
|
+
data.tar.gz: '0248a4920c9998e5c05b56b2f071308a09b6ff62419dd4e735af6bd2e276fb00'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c50f9e9991f07a91fd46d5f81be4fd846264960bd06c942fa190d9959f4559d41c3d5ab76520da0a4c897c600af29afa03a2f4ead5efbb1e496b53d7f7db0a19
|
7
|
+
data.tar.gz: bb7316920e34082949eadbd5b9c629d71a019ea9a9271c4226db8bbbef4284c7dc8e395b1d5385230c946cf6b6b251ca258da0cf339adf6c496ab541d1dcd475
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
Workarea Api 4.5.6 (2020-12-02)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Move creation of date filtering indexes to after initialize
|
5
|
+
|
6
|
+
The DateFiltering module that the admin API adds to ApplicationDocument
|
7
|
+
could cause some indexes on created_at or updated_at to be ignored
|
8
|
+
unexpectedly since DateFiltering had already added indexes for those
|
9
|
+
fields. Moving the creation of those indexes to after initialization
|
10
|
+
ensures the model can define its own indexes first.
|
11
|
+
|
12
|
+
API-17
|
13
|
+
|
14
|
+
Matt Duffy
|
15
|
+
|
16
|
+
|
17
|
+
|
1
18
|
Workarea Api 4.5.5 (2020-08-19)
|
2
19
|
--------------------------------------------------------------------------------
|
3
20
|
|
data/Rakefile
CHANGED
@@ -76,13 +76,13 @@ task :release do
|
|
76
76
|
# Build documentation
|
77
77
|
#
|
78
78
|
#
|
79
|
-
system <<~COMMAND
|
80
|
-
(cd admin && GENERATE_API_DOCS=true bin/rails test) &&
|
81
|
-
(cd storefront && GENERATE_API_DOCS=true bin/rails test) &&
|
82
|
-
git add doc/ &&
|
83
|
-
git commit -am "Update documentation" &&
|
84
|
-
git push origin HEAD
|
85
|
-
COMMAND
|
79
|
+
#system <<~COMMAND
|
80
|
+
#(cd admin && GENERATE_API_DOCS=true bin/rails test) &&
|
81
|
+
#(cd storefront && GENERATE_API_DOCS=true bin/rails test) &&
|
82
|
+
#git add doc/ &&
|
83
|
+
#git commit -am "Update documentation" &&
|
84
|
+
#git push origin HEAD
|
85
|
+
#COMMAND
|
86
86
|
|
87
87
|
#
|
88
88
|
# Updating changelog
|
@@ -4,9 +4,6 @@ module Workarea
|
|
4
4
|
module DateFiltering
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
included do
|
7
|
-
index({ updated_at: 1 })
|
8
|
-
index({ created_at: 1 })
|
9
|
-
|
10
7
|
scope :by_updated_at, ->(starts_at:, ends_at:) do
|
11
8
|
query = criteria
|
12
9
|
query = query.where(:updated_at.gte => starts_at) unless starts_at.nil?
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
module Workarea
|
3
|
+
module Api
|
4
|
+
module Admin
|
5
|
+
module DateIndexes
|
6
|
+
extend self
|
7
|
+
|
8
|
+
# We do this separately from the DateFiltering module to ensure
|
9
|
+
# this happens after a model has defined all of its normal indexes. This
|
10
|
+
# prevents the date filtering indexes from applying before explicity
|
11
|
+
# defined indexes for models that could include options like a TTL.
|
12
|
+
def load
|
13
|
+
::Mongoid.models.each do |model|
|
14
|
+
if model < ApplicationDocument
|
15
|
+
model.index({ updated_at: 1 })
|
16
|
+
model.index({ created_at: 1 })
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -14,10 +14,12 @@ module Workarea
|
|
14
14
|
|
15
15
|
config.after_initialize do
|
16
16
|
Workarea::Api::Admin::Swagger.generate!
|
17
|
+
Workarea::Api::Admin::DateIndexes.load
|
17
18
|
end
|
18
19
|
|
19
20
|
config.to_prepare do
|
20
21
|
ApplicationDocument.include(DateFiltering)
|
22
|
+
Workarea::Api::Admin::DateIndexes.load
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
data/lib/workarea/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: workarea
|
@@ -37,28 +37,28 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.5.
|
40
|
+
version: 4.5.6
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.5.
|
47
|
+
version: 4.5.6
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: workarea-api-admin
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.5.
|
54
|
+
version: 4.5.6
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.5.
|
61
|
+
version: 4.5.6
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: raddocs
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- admin/config/locales/en.yml
|
164
164
|
- admin/config/routes.rb
|
165
165
|
- admin/lib/workarea/api/admin.rb
|
166
|
+
- admin/lib/workarea/api/admin/date_indexes.rb
|
166
167
|
- admin/lib/workarea/api/admin/engine.rb
|
167
168
|
- admin/lib/workarea/api/admin/swagger.rb
|
168
169
|
- admin/test/documentation/workarea/api/admin/categories_documentation_test.rb
|