hal_api-rails 0.3.3 → 0.3.4
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 +4 -4
- data/lib/hal_api/controller/cache.rb +12 -1
- data/lib/hal_api/rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b3384e1c3f25a55759d4dee753c4ff4461c47790
|
|
4
|
+
data.tar.gz: db49716687ec2c401600e885d4c6a1ed9b5acfe4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32eea6448c3b32c6f2ad25e6031040c5fe10bf0c8c11de77f5b0c1b83c9d5f381eb87574b41320cf8aa3c1739858b92f0153050860ae7e3f70601d75e34dd997
|
|
7
|
+
data.tar.gz: 301c242a45939e7ee2f2997f3f64d59543fcbccf6694d5d34e3c9136c4294b091ebe02514dbec7977e40499e7d2f28481eeabce1d01c0ad9c6380dca85bcad94
|
|
@@ -12,8 +12,19 @@ module HalApi::Controller::Cache
|
|
|
12
12
|
).cache_key
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
def current_time
|
|
16
|
+
Datetime.now
|
|
17
|
+
end
|
|
18
|
+
|
|
15
19
|
def show_cache_path
|
|
16
|
-
show_resource.updated_at.
|
|
20
|
+
timestamp = show_resource.updated_at || show_resource.created_at
|
|
21
|
+
timestamp = if timestamp.nil?
|
|
22
|
+
# skip the cache
|
|
23
|
+
current_time
|
|
24
|
+
else
|
|
25
|
+
timestamp
|
|
26
|
+
end
|
|
27
|
+
timestamp.utc.to_i
|
|
17
28
|
end
|
|
18
29
|
|
|
19
30
|
module ClassMethods
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hal_api-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Rhoden
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-
|
|
12
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activemodel
|
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
252
252
|
version: '0'
|
|
253
253
|
requirements: []
|
|
254
254
|
rubyforge_project:
|
|
255
|
-
rubygems_version: 2.4.5
|
|
255
|
+
rubygems_version: 2.4.5.2
|
|
256
256
|
signing_key:
|
|
257
257
|
specification_version: 4
|
|
258
258
|
summary: JSON HAL APIs on Rails in the style of PRX
|