parametric 0.1.2 → 0.1.3

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: f882efaecdc92a64f9f74bf8c26545dc9d1f6610
4
- data.tar.gz: db613b987b0d2f3b02470ef04371310840e047f9
3
+ metadata.gz: 723fbc2c52d12ad990405295ef4a0a857d0d6638
4
+ data.tar.gz: 685e8e6b97ffebbf51e413e1780fcfd69bb626a4
5
5
  SHA512:
6
- metadata.gz: 5a4b6866c5c0936d92c4b06042c2b6fbae2c25f9cf6d39454e9949f5d60617dd85e0e6eaf4bd832361a4f160ac0d2df7f984a384b15de508471e61a8830da458
7
- data.tar.gz: 9e152c1a76b4db393cb2d221b8f8e55cdcb08796ee860af789c9c72225aa1479cb53fb0f2efeb18284d9c25f91adf4823963abdf7eb2e05384885cd200146bb9
6
+ metadata.gz: a5f63c830feb5c708b64be0d2de108949cd2b07a3157686f64b6535c77ca79fa157a24293a1983a17a69ce0c30cd24df6b482aad9a4d295e254ac2400771de00
7
+ data.tar.gz: 3eb0a6f083e87303716931e6e55247e044b7d969af09322638758029adef56c6c1ecf66c79f148ae7b14b3879a590835af1f5af83e6e8475517b9b76205ca7eb
@@ -14,7 +14,7 @@ module Parametric
14
14
  end
15
15
 
16
16
  def declared
17
- required.policy :declared
17
+ policy :declared
18
18
  end
19
19
 
20
20
  def options(opts)
@@ -1,3 +1,3 @@
1
1
  module Parametric
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -96,6 +96,17 @@ describe Parametric::Schema do
96
96
  end
97
97
  end
98
98
 
99
+ it "ignores nil fields if using :declared policy" do
100
+ schema = described_class.new do
101
+ field(:id).type(:integer)
102
+ field(:title).declared.type(:string)
103
+ end
104
+
105
+ resolve(schema, {id: 123}) do |results|
106
+ expect(results.output.keys).to eq [:id]
107
+ end
108
+ end
109
+
99
110
  describe "#policy" do
100
111
  it "applies policy to all fields" do
101
112
  subject.policy(:declared)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parametric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-23 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler