active_postgrest 0.2.2 → 0.2.3
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
- checksums.yaml.gz.sig +0 -0
- data/lib/active_postgrest/base.rb +5 -4
- data/lib/active_postgrest/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34e9d9caa6accb07084737f58f938aab67dacb5b65140d3d4a1016c440b2873f
|
|
4
|
+
data.tar.gz: 903062fdc887db2f3976a0b13dd83da47e6b58f91281f17eaaa834bcf464cf82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe68000001c2cc0ffe6132220264ad8e3f10f5952840d91bd34196f158b1d0676ae15a2971bfd72b1525bf2f79c1cdaa20b289fd61580afeabe5147dfc3436d2
|
|
7
|
+
data.tar.gz: ab5df335110509789c7d80d0521e766fcd7590cb54a7825923e14010ab5d70bc0b0c38c316640c9080c664bbfa515b6fc90dc1f6a3308c5a1cbf7921ce11172d
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -58,7 +58,8 @@ module ActivePostgrest
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def self.attribute_types
|
|
61
|
-
|
|
61
|
+
parent = superclass.respond_to?(:attribute_types) ? superclass.attribute_types : {}
|
|
62
|
+
parent.merge(@attribute_types || {})
|
|
62
63
|
end
|
|
63
64
|
|
|
64
65
|
def self.schema
|
|
@@ -219,11 +220,11 @@ module ActivePostgrest
|
|
|
219
220
|
key = name.to_s
|
|
220
221
|
if key.end_with?('=')
|
|
221
222
|
attr = key.delete_suffix('=')
|
|
222
|
-
if @attributes.key?(attr)
|
|
223
|
+
if @attributes.key?(attr) || self.class.attribute_types.key?(attr)
|
|
223
224
|
type = self.class.attribute_types[attr]
|
|
224
225
|
return @attributes[attr] = type ? cast_attribute(args.first, type) : args.first
|
|
225
226
|
end
|
|
226
|
-
elsif @attributes.key?(key)
|
|
227
|
+
elsif @attributes.key?(key) || self.class.attribute_types.key?(key)
|
|
227
228
|
return @attributes[key]
|
|
228
229
|
end
|
|
229
230
|
|
|
@@ -233,7 +234,7 @@ module ActivePostgrest
|
|
|
233
234
|
def respond_to_missing?(name, include_private = false)
|
|
234
235
|
key = name.to_s
|
|
235
236
|
attr = key.delete_suffix('=')
|
|
236
|
-
@attributes.key?(attr) || super
|
|
237
|
+
@attributes.key?(attr) || self.class.attribute_types.key?(attr) || super
|
|
237
238
|
end
|
|
238
239
|
|
|
239
240
|
def save # rubocop:disable Naming/PredicateMethod
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_postgrest
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Evgeny Sokolov
|
|
@@ -185,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
185
185
|
requirements:
|
|
186
186
|
- - ">="
|
|
187
187
|
- !ruby/object:Gem::Version
|
|
188
|
-
version: '3.
|
|
188
|
+
version: '3.2'
|
|
189
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
requirements:
|
|
191
191
|
- - ">="
|
metadata.gz.sig
CHANGED
|
Binary file
|