ocean-rails 6.1.3 → 6.1.4

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
  SHA1:
3
- metadata.gz: 33316f32cdf5c4f62920230b5fc9a9dee5c0d6cb
4
- data.tar.gz: 4634e081eb7394498dd21e06897e0b5a5a98a4c8
3
+ metadata.gz: 2c6feba83b83495464eccf885fe393675f8d7dfa
4
+ data.tar.gz: 5c59b3e4663bd2983e0de265848e8200ed193eda
5
5
  SHA512:
6
- metadata.gz: 791989de154a2a56e06899dc6c499de22ae86f2a6c6afc8701581ac269c39453a6774413689cc03853d706e8144ebb66f0806289edd3e3149c81503433c572ed
7
- data.tar.gz: 4eb65cbd9d4670a9914ee44f0bddef52250bbfd1f7526b93a129231483ed44bda27e17f8fa5a1cf6209e2a9a9d1b2713463c24f0f9d51dcb750d2746148a2bc4
6
+ metadata.gz: 80a5b60c2260279847f9ca9d9733f1fe94f59e3624af58a9afe5ab88556f0d06c005de2127c76ac93f08c19c002a28c05f5c9c820750ee82d049edb6c03a0e27
7
+ data.tar.gz: 769821c1d5e12a7884be727d8acdf7edfa9cf854b2f78873f6eae49b49aedab143992dd23e647a8b4d850ae21ffbfc47a4a590260aac7a0807cf7fe30cded8b3
@@ -5,14 +5,14 @@ require_dependency "<%= namespaced_file_path %>/application_controller"
5
5
  <% module_namespacing do -%>
6
6
  class <%= controller_class_name %>Controller < ApplicationController
7
7
 
8
- ocean_resource_controller required_attributes: [:lock_version]
8
+ ocean_resource_controller
9
9
 
10
10
  before_action :find_<%= singular_table_name %>, :only => [:show, :update, :destroy]
11
11
 
12
12
 
13
13
  # GET <%= route_url %>
14
14
  def index
15
- expires_in 0, 's-maxage' => 30.minutes
15
+ expires_in 0, 's-maxage' => DEFAULT_CACHE_TIME
16
16
  # if stale?(collection_etag(<%= class_name %>)) # collection_etag is still ActiveRecord only!
17
17
  # Instead, we get all the instances and compute the ETag manually.
18
18
  # You may wish to remove this action entirely. You may also wish to remove the caching,
@@ -28,7 +28,7 @@ class <%= controller_class_name %>Controller < ApplicationController
28
28
 
29
29
  # GET <%= route_url %>/a-b-c-d-e
30
30
  def show
31
- expires_in 0, 's-maxage' => 30.minutes
31
+ expires_in 0, 's-maxage' => DEFAULT_CACHE_TIME
32
32
  if stale?(etag: @<%= singular_table_name %>.lock_version, # NB: DynamoDB tables don't have cache_key - FIX!
33
33
  last_modified: @<%= singular_table_name %>.updated_at)
34
34
  api_render @<%= singular_table_name %>
@@ -76,7 +76,7 @@ module OceanApplicationController
76
76
  @group_names = a['group_names'].to_set if a['group_names']
77
77
  return true
78
78
  end
79
- error_messages = response.body['_api_error']
79
+ error_messages = response.body['_api_error'] rescue ["Not JSON: #{raw_body}"]
80
80
  render_api_error response.status, *error_messages
81
81
  expires_in 0, must_revalidate: true
82
82
  false
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "6.1.3"
2
+ VERSION = "6.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.3
4
+ version: 6.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus