store_model 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/store_model/model.rb +12 -0
- data/lib/store_model/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: 1c612c06744ac1427fd3c3d718e414592ce983734f6aa547e7ffe052b6ac0ef3
|
4
|
+
data.tar.gz: 349b6f3625d2d94a585c119a3e2080519f9509ee738633062a95364ffd47eb98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1df9be55ae81ae2648a1d1c9dc287731ae2954cbfbe9ea618d27aa50b954e5c867900b147aa7ede58382ecf21fcba8e62e6f1b2571700e1e64e76c834c16f69
|
7
|
+
data.tar.gz: 9224ce8f181e58f02e0fec9864acf1ba4c22e8a575d40ad6e3a66e354178c4c2b4478cb19e8290304da98fe06b0d862fd8da558f71f91ae4dc577d1f2a827000
|
data/lib/store_model/model.rb
CHANGED
@@ -11,10 +11,13 @@ module StoreModel
|
|
11
11
|
def self.included(base) # :nodoc:
|
12
12
|
base.include ActiveModel::Model
|
13
13
|
base.include ActiveModel::Attributes
|
14
|
+
base.include ActiveModel::AttributeMethods
|
14
15
|
base.include StoreModel::NestedAttributes
|
15
16
|
|
16
17
|
base.extend StoreModel::Enum
|
17
18
|
base.extend StoreModel::TypeBuilders
|
19
|
+
|
20
|
+
base.attribute_method_suffix "?"
|
18
21
|
end
|
19
22
|
|
20
23
|
attr_accessor :parent
|
@@ -110,5 +113,14 @@ module StoreModel
|
|
110
113
|
def unknown_attributes
|
111
114
|
@unknown_attributes ||= {}
|
112
115
|
end
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
def attribute?(attribute)
|
120
|
+
case value = attributes[attribute]
|
121
|
+
when 0 then false
|
122
|
+
else value.present?
|
123
|
+
end
|
124
|
+
end
|
113
125
|
end
|
114
126
|
end
|
data/lib/store_model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: store_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|