isomorfeus-data 2.5.1 → 2.5.4
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 198fe12b353be42d725a63ccd4495052c19a20a24e1f4223c3a2d4ac9c39fe4a
|
4
|
+
data.tar.gz: bd01e302b472b1a1c847c5c49c5139edcb619faa48adfcdc3fd7e49996fcfaec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 410185c046e6c116eeca7e87fc84813f1961e23fc822f487714ab367f7e0f4f8e2e9090206138d0a0de43813420b8c9efa351aa099c8e2582e41f4ae35aa9216
|
7
|
+
data.tar.gz: 7daa859033b8d5dd50d0dded8e3bcf3c2447ee825f0450358060ccee86ba32b55ea5a7cddad3e963d268db24c1545da9e7d56b1adc5e0ddca207d75c78d5ffc6
|
@@ -64,9 +64,13 @@ module Isomorfeus
|
|
64
64
|
field_types[obj_name] == :object
|
65
65
|
end
|
66
66
|
|
67
|
+
def validate_field!(field_name, val)
|
68
|
+
raise "no such field" unless field?(field_name)
|
69
|
+
Isomorfeus::Props::Validator.new(self.name, field_name, val, field_conditions[field_name]).validate!
|
70
|
+
end
|
71
|
+
|
67
72
|
def valid_field?(field_name, val)
|
68
|
-
|
69
|
-
false
|
73
|
+
validate_field!(field_name, val)
|
70
74
|
rescue
|
71
75
|
false
|
72
76
|
end
|
@@ -84,6 +88,7 @@ module Isomorfeus
|
|
84
88
|
rescue
|
85
89
|
false
|
86
90
|
end
|
91
|
+
alias valid_embed? valid_attribute?
|
87
92
|
|
88
93
|
def valid_object?(obj_name, val)
|
89
94
|
return valid_field?(obj_name, val) if object?(obj_name)
|
@@ -91,6 +96,7 @@ module Isomorfeus
|
|
91
96
|
rescue
|
92
97
|
false
|
93
98
|
end
|
99
|
+
alias valid_reference? valid_object?
|
94
100
|
|
95
101
|
def validate
|
96
102
|
Isomorfeus::Props::ValidateHashProxy.new
|
@@ -85,7 +85,7 @@ module Isomorfeus
|
|
85
85
|
|
86
86
|
def save_object(key, fields, already_saved)
|
87
87
|
id = get_object_id(key)
|
88
|
-
|
88
|
+
return create_object(key, fields, already_saved) unless id
|
89
89
|
ft = @object_class.field_types
|
90
90
|
hash = fields.to_h do |k, v|
|
91
91
|
[k, serialize_or_save(v, ft[k], already_saved)]
|
@@ -141,10 +141,19 @@ module LucidObject
|
|
141
141
|
end
|
142
142
|
|
143
143
|
def each(&block)
|
144
|
-
|
145
|
-
|
144
|
+
if block_given?
|
145
|
+
self.object_accelerator.each do |fields|
|
146
|
+
block.call self.new(key: fields.delete(:key), fields: fields)
|
147
|
+
end
|
148
|
+
else
|
149
|
+
Enumerator.new do |yielder|
|
150
|
+
self.object_accelerator.each do |fields|
|
151
|
+
yielder << self.new(key: fields.delete(:key), fields: fields)
|
152
|
+
end
|
153
|
+
end
|
146
154
|
end
|
147
155
|
end
|
156
|
+
alias to_enum each
|
148
157
|
|
149
158
|
def search(field = nil, val = nil, options = {}, query: nil)
|
150
159
|
if field && !self.field_options[field]&.fetch(:index) == :yes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.5.
|
103
|
+
version: 2.5.4
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.5.
|
110
|
+
version: 2.5.4
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: isomorfeus-policy
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 2.5.
|
117
|
+
version: 2.5.4
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 2.5.
|
124
|
+
version: 2.5.4
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: isomorfeus-preact
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,28 +156,28 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - '='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.5.
|
159
|
+
version: 2.5.4
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.5.
|
166
|
+
version: 2.5.4
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: isomorfeus
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - '='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.5.
|
173
|
+
version: 2.5.4
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - '='
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.5.
|
180
|
+
version: 2.5.4
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rake
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|