ocean-rails 2.0.0 → 2.0.1

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: 8d50f55650536248f495678bc60191b637fea7b5
4
- data.tar.gz: 8924c3a57ae0ed5098015df1471a1858c15aa86f
3
+ metadata.gz: d8d0e06a51eb9695e45cbd3117875807398ad746
4
+ data.tar.gz: bc840097a5de048b4b8256ad656b8618abb1a4b5
5
5
  SHA512:
6
- metadata.gz: 89c81188c0778ff56b56a0278b09e3ab215208e425f14a9a118151836404d6d1ddeb64a88b0c8a7b44c0aab917dbb850b243056fbfcd70a1d371c3d91e92772a
7
- data.tar.gz: 98370a8598bf8716a4b77362062637fc1d80f24d25d97eba8434eecf5a3b39ad3f74ba0eb77beba05c9d990e33036d641e392c10377b79607cf08cb23252a083
6
+ metadata.gz: f72419c440325db8eb7d82f9d5f397c93e0c007c068738ab00842246a70a7619a7ca067f54b3d6f562bf25adc8a41685eec066a069a2e3dbc8ad130736f2d63d
7
+ data.tar.gz: dff353241989bd4c3bbb4a8ff65e6e93b5bb6640698d0cd808c6f5201a9cfc58e2a3067e7796394458a00b9bbf77754cb80e364ac05d611c58c4dbca051c622e
@@ -176,10 +176,14 @@ module OceanApplicationController
176
176
  else
177
177
  resources = x.collect { |m| render_to_string(partial: m.to_partial_path,
178
178
  locals: {m.class.model_name.i18n_key => m}) }
179
- attrs = {count: resources.count}
179
+ attrs = {count: resources.count,
180
+ total_count: x.unscope(:where, :order, :limit, :offset, :group, :having).count,
181
+ _links: {self: {href: request.url, type: 'application/json'}
182
+ }
183
+ }
180
184
  render text: '{"_collection":{"resources":[' + resources.join(',') + ']' +
181
185
  (attrs.collect do |k, v|
182
- ',"' + k.to_s + '":' + v.to_s
186
+ ',"' + k.to_s + '":' + v.to_json
183
187
  end).join('') +
184
188
  '}}'
185
189
  end
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-12 00:00:00.000000000 Z
11
+ date: 2014-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday