foobara-active-record-type 0.0.2 → 0.0.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: 3499a493db193b496a20ae4dd0d1dd1d7ad5193701346ee2de9abc397b107ff9
|
4
|
+
data.tar.gz: 59db77d01419543a0230aecb0d5f49aa6f1ba541bb820d7ffd743ee41211d2ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a72802f7ae7ef65f5174285ae4dde77f7876b3463ea3d6a69bc7366a91838b5e1a22b94a8c6352b3725755195121855f391a30163378ceb065cfd16c6d9b9622
|
7
|
+
data.tar.gz: b49ed2b61b22d34e1b0179c841e2deb05ac5b0886fa71826bcb781f1572e6c52323ed729cd2ae7b058d5e078a184fb872e8dff4329fdd8184c557f7ef15332f0
|
data/CHANGELOG.md
CHANGED
@@ -10,8 +10,10 @@ module Foobara
|
|
10
10
|
active_record_superclass = active_record_class.superclass
|
11
11
|
|
12
12
|
if active_record_superclass != ActiveRecord::Base
|
13
|
-
|
14
|
-
|
13
|
+
if active_record_superclass.attribute_names.include?(active_record_class.primary_key)
|
14
|
+
# this will register a foobara type for the base class
|
15
|
+
type_for_declaration(active_record_class.superclass)
|
16
|
+
end
|
15
17
|
end
|
16
18
|
|
17
19
|
{
|
@@ -13,7 +13,9 @@ module Foobara
|
|
13
13
|
handler = handler_for_class(TypeDeclarations::Handlers::ExtendAttributesTypeDeclaration)
|
14
14
|
attributes_type_declaration = type.declaration_data[:attributes_declaration]
|
15
15
|
|
16
|
-
|
16
|
+
active_record_class.foobara_attributes_type = handler.process_value!(attributes_type_declaration)
|
17
|
+
|
18
|
+
type.element_types = active_record_class.foobara_attributes_type.element_types
|
17
19
|
type_name = type.declaration_data[:name]
|
18
20
|
|
19
21
|
# We don't want to check that the active record is valid as if it were a model
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-active-record-type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activerecord
|