rom-factory 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Gemfile +1 -0
- data/lib/rom/factory/builder.rb +10 -0
- data/lib/rom/factory/builder/persistable.rb +1 -0
- data/lib/rom/factory/constants.rb +6 -0
- data/lib/rom/factory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 405ffd84ef6d6c604dc925be2d885f9639986893281dea271ae65584505e40a3
|
4
|
+
data.tar.gz: 78e65374754604602d984aba6a0b7374041b5972fcd464187f6d0ec2a7a919a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c787c81d9545fa094c84751dd81e0f2fcb4d66de479354f9fe44dd7b6df8442bdf4c913998cad3584ad3ff2e4741603edcfb1508e9eec3067c32686f1889ef81
|
7
|
+
data.tar.gz: 8128cb92776ecedc10e7da0d5e5213f4f4bb6b8663d3ace72a19cd2cf985cd78d85744119d3e61b7dfc4ac44478a912966fd9c14a59b48f463140d164a81827f
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.9.0 2019-08-12
|
2
|
+
|
3
|
+
### Added
|
4
|
+
|
5
|
+
* When attributes hash includes unknown attributes, a `ROM::Factory::UnknownAttributeError` will be raised (@rawburt)
|
6
|
+
|
7
|
+
[Compare v0.8.0...v0.9.0](https://github.com/rom-rb/rom-factory/compare/v0.8.0...v0.9.0)
|
8
|
+
|
9
|
+
## 0.8.0 2019-04-24
|
2
10
|
|
3
11
|
### Fixed
|
4
12
|
|
data/Gemfile
CHANGED
data/lib/rom/factory/builder.rb
CHANGED
@@ -33,6 +33,7 @@ module ROM::Factory
|
|
33
33
|
|
34
34
|
# @api private
|
35
35
|
def struct(*traits, **attrs)
|
36
|
+
validate_keys(traits, attrs)
|
36
37
|
tuple_evaluator.struct(*traits, attrs)
|
37
38
|
end
|
38
39
|
alias_method :create, :struct
|
@@ -56,5 +57,14 @@ module ROM::Factory
|
|
56
57
|
def relation
|
57
58
|
tuple_evaluator.relation
|
58
59
|
end
|
60
|
+
|
61
|
+
# @api private
|
62
|
+
def validate_keys(traits, tuple)
|
63
|
+
schema_keys = relation.schema.attributes.map(&:name)
|
64
|
+
assoc_keys = tuple_evaluator.assoc_names(traits)
|
65
|
+
unknown_keys = tuple.keys - schema_keys - assoc_keys
|
66
|
+
|
67
|
+
raise UnknownFactoryAttributes, unknown_keys unless unknown_keys.empty?
|
68
|
+
end
|
59
69
|
end
|
60
70
|
end
|
data/lib/rom/factory/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janis Miezitis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-configurable
|