schema-model 0.4.4 → 0.4.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 +4 -4
- data/lib/{schema.rb → schema-model.rb} +0 -0
- data/lib/schema/all.rb +2 -2
- data/lib/schema/model.rb +1 -1
- data/lib/schema/parsers/common.rb +3 -3
- data/lib/schema/utils.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 735e5daf6fa7d40bdf226e1c8c8ca09c0853e0acc0f18a157d9ed2445380b19c
|
4
|
+
data.tar.gz: '0808f77eeffc6139aca691c8121e068ad42b3187f7a261647aaf71bec83379a3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c795d6e57064a1409d98b1d61603f3bdb24d1ae784bd598dd7e1a6fef07d581e76eeb2fb2a8a0c33bd1220b5585e6cfeb9a91d6385df6badec5cf71b0e9fee4
|
7
|
+
data.tar.gz: 7ab2716a86eb341ba0cc4e73f236d29b3190b1e1e003ef74cdfbcf44c1afed4fbb1c6d487dada5b3cd30ff383564f0266ce3e3e3f98a06630ab2e203aa538fba
|
File without changes
|
data/lib/schema/all.rb
CHANGED
@@ -6,7 +6,7 @@ module Schema
|
|
6
6
|
# Schema::All includes model, associations, parsers and active model validations
|
7
7
|
module All
|
8
8
|
def self.included(base)
|
9
|
-
base.include ::Schema::Model
|
9
|
+
base.send(:include, ::Schema::Model)
|
10
10
|
|
11
11
|
# associations
|
12
12
|
base.schema_include ::Schema::Associations::HasOne
|
@@ -19,7 +19,7 @@ module Schema
|
|
19
19
|
base.schema_include ::Schema::Parsers::Json
|
20
20
|
|
21
21
|
# active model validations
|
22
|
-
base.include ::Schema::ActiveModelValidations
|
22
|
+
base.send(:include, ::Schema::ActiveModelValidations)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/schema/model.rb
CHANGED
@@ -16,7 +16,7 @@ module Schema
|
|
16
16
|
when Integer
|
17
17
|
value
|
18
18
|
when String
|
19
|
-
if INTEGER_REGEX.match
|
19
|
+
if INTEGER_REGEX.match(value)
|
20
20
|
Integer(value)
|
21
21
|
else
|
22
22
|
parsing_errors.add(field_name, ::Schema::ParsingErrors::INVALID)
|
@@ -55,7 +55,7 @@ module Schema
|
|
55
55
|
when Integer
|
56
56
|
value.to_f
|
57
57
|
when String
|
58
|
-
if FLOAT_REGEX.match
|
58
|
+
if FLOAT_REGEX.match(value)
|
59
59
|
Float(value)
|
60
60
|
else
|
61
61
|
parsing_errors.add(field_name, ::Schema::ParsingErrors::INVALID)
|
@@ -118,7 +118,7 @@ module Schema
|
|
118
118
|
when Integer, Float
|
119
119
|
value != 0
|
120
120
|
when String
|
121
|
-
BOOLEAN_REGEX.match
|
121
|
+
BOOLEAN_REGEX.match(value)
|
122
122
|
when nil
|
123
123
|
nil
|
124
124
|
else
|
data/lib/schema/utils.rb
CHANGED
@@ -18,7 +18,7 @@ module Schema
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def include_schema_modules(kls, schema_config)
|
21
|
-
kls.include ::Schema::Model
|
21
|
+
kls.send(:include, ::Schema::Model)
|
22
22
|
schema_config[:schema_includes].each do |mod|
|
23
23
|
kls.schema_include(mod)
|
24
24
|
end
|
@@ -44,7 +44,7 @@ module Schema
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def add_association_defaults(kls, base_schema_class, schema_name)
|
47
|
-
kls.include ::Schema::Associations::Base
|
47
|
+
kls.send(:include, ::Schema::Associations::Base)
|
48
48
|
kls.base_schema_class = base_schema_class
|
49
49
|
kls.schema_name = schema_name
|
50
50
|
end
|
@@ -52,7 +52,7 @@ module Schema
|
|
52
52
|
def add_association_dynamic_types(kls, options)
|
53
53
|
return if !options[:type_field] && !options[:external_type_field]
|
54
54
|
|
55
|
-
kls.include ::Schema::Associations::DynamicTypes
|
55
|
+
kls.send(:include, ::Schema::Associations::DynamicTypes)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Youch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inheritance-helper
|
@@ -30,7 +30,7 @@ executables: []
|
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
|
-
- lib/schema.rb
|
33
|
+
- lib/schema-model.rb
|
34
34
|
- lib/schema/active_model_validations.rb
|
35
35
|
- lib/schema/all.rb
|
36
36
|
- lib/schema/array_headers.rb
|