locomotive_cms 2.5.0.rc2 → 2.5.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/presenters/locomotive/base_presenter.rb +1 -1
- data/lib/locomotive/render.rb +14 -2
- data/lib/locomotive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e4f6d7acbadf388d2cd5a4bf51352f19df782de
|
4
|
+
data.tar.gz: 1a008446466bed982993fd8f242044891bfe56cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6819e5333cb5dc37c123edce04128bef0f28159c156675eb399aaa2ba421305e61b784ec2a9057d749b9eab2a4527fd3ebb71b108f0b0fd8a5330cf6f8632eba
|
7
|
+
data.tar.gz: 049328daef7e2bdb06810408fee6dbbf8f340f4b3031532c6f15a85944dd576ceb9cde30c9b3ab8abec1c388942fce9b3b00aa1c51f50be4f663c40aad2444df
|
@@ -115,7 +115,7 @@ class Locomotive::BasePresenter
|
|
115
115
|
def self.getters_to_hash
|
116
116
|
{}.tap do |hash|
|
117
117
|
self.getters.each do |name|
|
118
|
-
next if %w(_id
|
118
|
+
next if %w(_id created_at updated_at).include?(name)
|
119
119
|
hash[name] = self.getters_or_setters_to_hash(name)
|
120
120
|
end
|
121
121
|
|
data/lib/locomotive/render.rb
CHANGED
@@ -65,13 +65,25 @@ module Locomotive
|
|
65
65
|
response.headers['Content-Type'] = "#{@page.response_type}; charset=utf-8"
|
66
66
|
response.headers['Editable'] = 'true' unless self.editing_page? || current_locomotive_account.nil?
|
67
67
|
|
68
|
+
# Inputs which define the ETag for this response
|
69
|
+
etag_inputs = {
|
70
|
+
'page' => @page,
|
71
|
+
'params' => {
|
72
|
+
'page_path' => params[:page_path],
|
73
|
+
'locale' => params[:locale]
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
68
77
|
if @page.with_cache?
|
69
|
-
fresh_when etag:
|
78
|
+
fresh_when etag: etag_inputs, last_modified: @page.updated_at.utc, public: true
|
70
79
|
|
71
80
|
if @page.cache_strategy != 'simple' # varnish
|
72
81
|
response.headers['Editable'] = ''
|
73
82
|
response.cache_control[:max_age] = @page.cache_strategy
|
74
83
|
end
|
84
|
+
else
|
85
|
+
# Set the ETag on uncached responses otherwise Rails will set it based on content only
|
86
|
+
fresh_when etag: etag_inputs
|
75
87
|
end
|
76
88
|
|
77
89
|
render text: output, layout: false, status: page_status unless performed?
|
@@ -220,4 +232,4 @@ module Locomotive
|
|
220
232
|
end
|
221
233
|
|
222
234
|
end
|
223
|
-
end
|
235
|
+
end
|
data/lib/locomotive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotive_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.0.
|
4
|
+
version: 2.5.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|