kea-rails 1.0.7 → 1.0.8

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: 3aa013e5c44870c868d67d3fd66427ab6f076c1c
4
- data.tar.gz: 629e172acfeb6784562c7e58093b5fa6ea3203ee
3
+ metadata.gz: 83ede11805e19e8745995c510c8f303609610190
4
+ data.tar.gz: 7673678239b7ff940f9752b6a74036491da22e5c
5
5
  SHA512:
6
- metadata.gz: e9a6f3eb0e2d9ea58e4b3ab79ea4f71e9030396731854616cb12d0606217a1d27b55b1d146ecb9acf10003b829c8f470ffa9e7c04ffad3aa57327feb8de252da
7
- data.tar.gz: 695f3a9528477f023468e3a4c631a2eca29e9f993631f95ce822695c8f61e30a2b2d73883352783a91f491828081affe279c1954d8b9a77e774480ee735d9431
6
+ metadata.gz: d49bd7fb152f21d4cd1f1e82b8c653a6e50ae7032a873dcb080262bbd120f82d7b9f023fdd2e19c5a5db825225624cadb9f970d4f373891af89b779532b7111a
7
+ data.tar.gz: 2fd2673d9ab89afa7a5b9b831e583bfb24954c06fb826e774fd2e3ec0bd9599b7e3c008c7afd54b0771511a4641bda7ff62baab2473888784529067725a6716c
@@ -60,12 +60,12 @@
60
60
 
61
61
  this.isValidatable = ko.observable(false);
62
62
 
63
- this.makeValidatable = function makeValidatable() {
63
+ this.makeValidatable = function makeValidatable(options) {
64
64
  if (DEBUG) {
65
65
  console.assert(this.attachValidators, "object does not implement attachValidators");
66
66
  }
67
67
 
68
- this.attachValidators();
68
+ this.attachValidators(options);
69
69
  this.isValidatable(true);
70
70
  };
71
71
 
@@ -14,7 +14,11 @@ module Kea
14
14
 
15
15
  serializer = options[:serializer] || target.active_model_serializer
16
16
 
17
- serializer.new(target, options).to_json
17
+ if target.is_a?(ActiveRecord::Relation)
18
+ ActiveModel::ArraySerializer.new(target, each_serializer: serializer, scope: self).to_json
19
+ else
20
+ serializer.new(target, options).to_json
21
+ end
18
22
  end
19
23
 
20
24
  def cache_json(object, path = nil, options = {})
@@ -1,3 +1,3 @@
1
1
  module Kea
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kea-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan-Christian Foeh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-25 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails