locomotive_cms 2.5.0.rc2 → 2.5.0.rc3

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
  SHA1:
3
- metadata.gz: 445a239a0a0d6b9f30fec36b880d297f837a81cc
4
- data.tar.gz: 383dc6883e250d582c10ec52e8fe251f0db76717
3
+ metadata.gz: 2e4f6d7acbadf388d2cd5a4bf51352f19df782de
4
+ data.tar.gz: 1a008446466bed982993fd8f242044891bfe56cc
5
5
  SHA512:
6
- metadata.gz: 77446b33a479d73220ec27e8925377074bad411ac2d10865dbd94ccedb2eb81aad5e3559aab2695390a1ec6fb2cb76b7a1e2e3c01a3ac735862e8466dfb4d085
7
- data.tar.gz: c2885bd30892cf699bc6c75983232594e0289f0062f567c1322fce86f5cebffab10f8029e5742c7cab88efd16ad75163c161da30f389b7c1dacfd88809624139
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 screated_at updated_at).include?(name)
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
 
@@ -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: @page, last_modified: @page.updated_at.utc, public: true
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
@@ -1,3 +1,3 @@
1
1
  module Locomotive #:nodoc
2
- VERSION = '2.5.0.rc2'
2
+ VERSION = '2.5.0.rc3'
3
3
  end
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.rc2
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-21 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake