croods 0.2.6 → 0.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da70e6c23805cc55c8a4d7db9e97adc567a4bcd436fb0296600238e9826955c7
4
- data.tar.gz: 43415c1a16fdefeaa51fc4dd5cf4b7c93121c8f16fbefefee5966af4ac714766
3
+ metadata.gz: 1d384b5ea86ec6b48095b9772afb47414627799144627547722b6322aae58d73
4
+ data.tar.gz: e58a394c1e3c9bd4b6787c092a09d1bb6582e313151baaedcb9ec0aee8c72735
5
5
  SHA512:
6
- metadata.gz: 3ea56e2741d2559944657daeeb73ef18cee25a381da09e50fe5f430cc4ae008015ec241e60cf96b7c931cc998fce5333fdd7f13e9e978d6f4ca890ece42554b7
7
- data.tar.gz: da63eb7581f72c974162b6c905d438ba7afa2b8f18b1c5d319d675e8821c7a3aae4fbb3a420f46f4c09b8548911a53fd2d1b3915b7609859fdac6be82c6ac2b2
6
+ metadata.gz: 369cc10370be1f7e010d07a858143d929292633752286529b72c7f5558195146a350e5071585adb6a35d6c2edb1bf2a4915ab87f293001fc5669f90a0f46e77c
7
+ data.tar.gz: ffaec510b409f9cd1d93337aa9939af86d685f4d144cc9e6a06b8fe259a0fabbe1d60fb9628d90ea53ebcf5d313d02d8a3d09b49d548d8aac86abcb56710673b
@@ -5,11 +5,12 @@ module Croods
5
5
  module JsonSchema
6
6
  module Definition
7
7
  TYPES = {
8
- datetime: 'string',
9
- date: 'string',
10
- text: 'string',
11
- json: 'object',
12
- float: 'number'
8
+ datetime: ['string'],
9
+ date: ['string'],
10
+ text: ['string'],
11
+ json: %w[object array],
12
+ jsonb: %w[object array],
13
+ float: ['number']
13
14
  }.freeze
14
15
 
15
16
  class << self
@@ -30,13 +31,18 @@ module Croods
30
31
 
31
32
  def types(attribute)
32
33
  types = []
33
- types << type(attribute.type)
34
- types << 'null' if attribute.null
34
+ converted_types(attribute.type).each do |converted_type|
35
+ types << converted_type
36
+ end
37
+ null = (
38
+ attribute.null || attribute.default || attribute.default_function
39
+ )
40
+ types << 'null' if null
35
41
  types
36
42
  end
37
43
 
38
- def type(type)
39
- TYPES[type] || type.to_s
44
+ def converted_types(type)
45
+ TYPES[type] || [type.to_s]
40
46
  end
41
47
  end
42
48
  end
@@ -26,7 +26,7 @@ module Croods
26
26
  end
27
27
 
28
28
  def policy_scope_name(action)
29
- "#{model_name}#{action.to_s.camelize}Scope"
29
+ "#{model_name}#{action.to_s.titleize.gsub(/\ /, '')}Scope"
30
30
  end
31
31
 
32
32
  def create_policy!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Croods
4
- VERSION = '0.2.6'
4
+ VERSION = '0.2.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: croods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Weinmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-13 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: committee