ph_model 1.1.2 → 1.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b21ee085fad1255502d03a29da7c57d01cbea98465169b750643ad41544170fe
|
4
|
+
data.tar.gz: b558977aa8e7620fb580b5861f7706b8af7019363debc34c6465b7236f11f750
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e381cc246de657326afcb31e75b8a6dd7e48f1dfde51b8645b66d9efee197381838c996ffebd89884e57447e496116153fa1679b885488e89784862d65193c9e
|
7
|
+
data.tar.gz: 2c86ce6deccccf5e63332c9e3c6387d7195254cc6b8e02a7220d8a7462a53f13c9adae2c9c6dc30baa70e0d1a133d64c96fb98ca65a99c9d14d5b7b4a18449e6
|
@@ -27,7 +27,8 @@ module PhModel
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def check_one(value, attribute_name)
|
30
|
-
return if !value.respond_to?(:valid?) || !value.respond_to?(:errors) || value.errors.nil? ||
|
30
|
+
return if !value.respond_to?(:valid?) || !value.respond_to?(:errors) || value.errors.nil? ||
|
31
|
+
(value.respond_to?(:frozen?) && value.frozen?) || value.valid?
|
31
32
|
value.errors.full_messages.each do |message|
|
32
33
|
errors.add(:base, "#{attribute_name}.#{message}")
|
33
34
|
end
|
@@ -40,8 +40,8 @@ module PhModel
|
|
40
40
|
when nil
|
41
41
|
true
|
42
42
|
when Array
|
43
|
-
if type.count
|
44
|
-
|
43
|
+
if type.count > 1
|
44
|
+
type.any? { |typ| value.is_a?(typ) }
|
45
45
|
else
|
46
46
|
if value.kind_of? Array
|
47
47
|
value.all? { |item| item.is_a?(type.first) }
|
data/lib/ph_model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ph_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Banasik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|