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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 276de717bb5ff48a395f63a5c778194ba660cfda61c13eaed97e71043673ba35
4
- data.tar.gz: 83274d331de650e3a54a706c9aaeac953e45cba044a83d3f57c8509999159b8a
3
+ metadata.gz: 34e9d9caa6accb07084737f58f938aab67dacb5b65140d3d4a1016c440b2873f
4
+ data.tar.gz: 903062fdc887db2f3976a0b13dd83da47e6b58f91281f17eaaa834bcf464cf82
5
5
  SHA512:
6
- metadata.gz: ad008e75b0d00d2b25dd4a095b28ea0c4de88893b223c7b69a239650464f797f4216e7ac2917be62ef1a0947627bcd35247f5dfd3dde7a44d0b920f11d6b1357
7
- data.tar.gz: e0969cdb78a04b2e8ca0d8f8038681cd5c480ee85d0ec2c0ff63de28fa3b65c21bf9fc1fbb6edb51f5d361c4ac57fc220328f78e7f8ca797d6e21ea2eb70d159
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
- @attribute_types || {}
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
@@ -2,5 +2,5 @@
2
2
  # Copyright 2026 Evgeny Sokolov (FastJoe)
3
3
 
4
4
  module ActivePostgrest
5
- VERSION = '0.2.2'.freeze
5
+ VERSION = '0.2.3'.freeze
6
6
  end
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.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.0'
188
+ version: '3.2'
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - ">="
metadata.gz.sig CHANGED
Binary file