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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d35b741fa9c5e6b037bbd68927bc8649fc84f8af37d2f78a985cfa69152dfcd
4
- data.tar.gz: c49d4e7241cd13cbe04d243efb260563b6f3dd9a4fd5e3c28a5ce45b5843ebbe
3
+ metadata.gz: c52a8de8a28e60162f058703b686dcd3b4f776a51990bcc90bd1b0ff89609fd7
4
+ data.tar.gz: 316c87edf83b117562e961ba666452468af720523bd948ed88cd691438b57937
5
5
  SHA512:
6
- metadata.gz: bcac97ad438cce9af46f52444acbcc27c6124a8c73cc05d186778b1db3c527ecbfefffaa0ee19cab1dd8936cbb1f8c28ae8fa9964c04ec9599c748ca94add9f3
7
- data.tar.gz: 457eae026dfbcbff8eefd1720dc659fea6f79e97259a9106988c5c5ccab77b5653d0c594bdb4a747d3ec3a8334ce3e6162a47f36dce165f6162471a1bde06ab2
6
+ metadata.gz: b49614cb897afa01b679aabf5c8dbb2b10c5410212a71972dedd462850d97dbfa020d1e1ddb75571881e53f2d6c99b7006d7c1bd410a0f7bd1b7dbe10632832e
7
+ data.tar.gz: c7585f401423c84cc9ca593107fe991a390ca4b58969a0ac56f6630df47a13baf9da710c55a7c92e0a4f7a13bce088585e2fa33439b095dcdb2f0774ac5b15a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- locomotivecms_steam (1.6.0.beta1)
4
+ locomotivecms_steam (1.6.0.rc1)
5
5
  RedCloth (~> 4.3.2)
6
6
  autoprefixer-rails (~> 8.0.0)
7
7
  bcrypt (~> 3.1.11)
@@ -65,8 +65,8 @@ module Locomotive::Steam
65
65
 
66
66
  alias :to_hash :translations
67
67
 
68
- def serialize(attributes)
69
- attributes[@name] = @translations
68
+ def serialize(attributes, custom_name = nil)
69
+ attributes[custom_name || @name] = @translations
70
70
  end
71
71
 
72
72
  def to_json
@@ -76,7 +76,8 @@ module Locomotive::Steam
76
76
 
77
77
  # localized fields
78
78
  @localized_attributes.each do |name|
79
- entity.send(name).serialize(attributes)
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)
@@ -3,6 +3,6 @@
3
3
  # 1.0.0.alpha < 1.0.0.alpha1 < 1.0.0.beta < 1.0.0.beta2 < 1.0.0.beta11 < 1.0.0.rc1 < 1.0.0
4
4
  module Locomotive
5
5
  module Steam
6
- VERSION = '1.6.0.beta1'
6
+ VERSION = '1.6.0.rc1'
7
7
  end
8
8
  end
@@ -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('9c535e0c37793cf8134e8b88b2517197').and_return(response) }
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('9c535e0c37793cf8134e8b88b2517197', Marshal.dump([200, {}, ["Hello world!"]])) }
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 '9c535e0c37793cf8134e8b88b2517197' }
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) { '9c535e0c37793cf8134e8b88b2517197' }
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.beta1
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-03 00:00:00.000000000 Z
14
+ date: 2021-09-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake