locomotivecms_steam 1.6.0.beta1 → 1.6.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/locomotive/steam/models/i18n_field.rb +2 -2
- data/lib/locomotive/steam/models/mapper.rb +2 -1
- data/lib/locomotive/steam/services/content_entry_service.rb +12 -0
- data/lib/locomotive/steam/version.rb +1 -1
- data/spec/unit/middlewares/cache_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c52a8de8a28e60162f058703b686dcd3b4f776a51990bcc90bd1b0ff89609fd7
|
4
|
+
data.tar.gz: 316c87edf83b117562e961ba666452468af720523bd948ed88cd691438b57937
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b49614cb897afa01b679aabf5c8dbb2b10c5410212a71972dedd462850d97dbfa020d1e1ddb75571881e53f2d6c99b7006d7c1bd410a0f7bd1b7dbe10632832e
|
7
|
+
data.tar.gz: c7585f401423c84cc9ca593107fe991a390ca4b58969a0ac56f6630df47a13baf9da710c55a7c92e0a4f7a13bce088585e2fa33439b095dcdb2f0774ac5b15a2
|
data/Gemfile.lock
CHANGED
@@ -76,7 +76,8 @@ module Locomotive::Steam
|
|
76
76
|
|
77
77
|
# localized fields
|
78
78
|
@localized_attributes.each do |name|
|
79
|
-
|
79
|
+
# hack: force the name for select type fields (content entries only)
|
80
|
+
entity.send(name).serialize(attributes, name)
|
80
81
|
end
|
81
82
|
|
82
83
|
# association name -> id (belongs_to) or ids (many_to_many)
|
@@ -73,6 +73,7 @@ module Locomotive
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
# Warning: do not work with localized and file fields
|
76
77
|
def update_decorated_entry(decorated_entry, attributes)
|
77
78
|
with_repository(decorated_entry.content_type) do |_repository|
|
78
79
|
entry = decorated_entry.__getobj__
|
@@ -80,6 +81,17 @@ module Locomotive
|
|
80
81
|
|
81
82
|
entry.change(_attributes)
|
82
83
|
|
84
|
+
# remove the proxy select fields because we don't need them at this point
|
85
|
+
# and MongoDB is going to complain when persisting it.
|
86
|
+
_repository.content_type.select_fields.each do |field|
|
87
|
+
entry.attributes.delete(field.name)
|
88
|
+
end
|
89
|
+
|
90
|
+
# remove any association field
|
91
|
+
_repository.content_type.association_fields.each do |field|
|
92
|
+
entry.attributes.delete(field.name)
|
93
|
+
end
|
94
|
+
|
83
95
|
_repository.update(entry)
|
84
96
|
|
85
97
|
logEntryOperation(decorated_entry.content_type.slug, decorated_entry)
|
@@ -55,11 +55,11 @@ describe Locomotive::Steam::Middlewares::Cache do
|
|
55
55
|
|
56
56
|
let(:response) { nil }
|
57
57
|
|
58
|
-
before { expect(cache).to receive(:read).with('
|
58
|
+
before { expect(cache).to receive(:read).with('7cf53dab8a56bd5d2cbf7610101514fd').and_return(response) }
|
59
59
|
|
60
60
|
context 'the cache is empty' do
|
61
61
|
|
62
|
-
before { expect(cache).to receive(:write).with('
|
62
|
+
before { expect(cache).to receive(:write).with('7cf53dab8a56bd5d2cbf7610101514fd', Marshal.dump([200, {}, ["Hello world!"]])) }
|
63
63
|
|
64
64
|
it 'tells the CDN to cache the page and also cache it internally' do
|
65
65
|
is_expected.to eq ['max-age=0, s-maxage=3600, public, must-revalidate', 'Accept-Language']
|
@@ -69,7 +69,7 @@ describe Locomotive::Steam::Middlewares::Cache do
|
|
69
69
|
|
70
70
|
subject { send_request[:env]['steam.cache_etag'] }
|
71
71
|
|
72
|
-
it { is_expected.to eq '
|
72
|
+
it { is_expected.to eq '7cf53dab8a56bd5d2cbf7610101514fd' }
|
73
73
|
|
74
74
|
end
|
75
75
|
|
@@ -104,7 +104,7 @@ describe Locomotive::Steam::Middlewares::Cache do
|
|
104
104
|
|
105
105
|
context 'based on the ETag' do
|
106
106
|
|
107
|
-
let(:etag) { '
|
107
|
+
let(:etag) { '7cf53dab8a56bd5d2cbf7610101514fd' }
|
108
108
|
|
109
109
|
it 'returns a 304 (Not modified) without no cache headers' do
|
110
110
|
expect(subject.first).to eq 304
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotivecms_steam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.0.
|
4
|
+
version: 1.6.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-09-
|
14
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|