foobara-active-record-type 0.0.8 → 0.0.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a325eb468219f2eb1f4033930b08a6c02cf15363a87fe4194bfbe3bec9098c1
|
4
|
+
data.tar.gz: 9a19c1c2e8035274d0db2764c397ff3917f284dab9f3f5badc6b6a5e9dd7dbe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 427fd034fd661cee2f79b6278b9d95a6174a367e818b307735bbedaaa03d5517b7f28e2b3078987bbc47b704b83153333ce607d9866deb9ecacbd2714c9fe6a1
|
7
|
+
data.tar.gz: 3e59d009474d55909f040a4ee2fbb2b6142b9c50cb1d5f15c6a8e2be282b05da7606be341b8731541c87e8316b8819f6a12b76def43baef8b1fe21de2a365149
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.0.10] - 2025-01-29
|
2
|
+
|
3
|
+
- Fix bug causing duplication of domain name in type name
|
4
|
+
|
5
|
+
## [0.0.9] - 2025-01-28
|
6
|
+
|
7
|
+
- Fix problem with attributes declaration validator breaking things
|
8
|
+
|
1
9
|
## [0.0.8] - 2025-01-25
|
2
10
|
|
3
11
|
- Add some serializers to handle active record serialization
|
@@ -10,12 +10,13 @@ module Foobara
|
|
10
10
|
TypeDeclarations.register_type_declaration(ExtendActiveRecordTypeDeclaration.new)
|
11
11
|
|
12
12
|
detached_entity = Namespace.global.foobara_lookup_type!(:detached_entity)
|
13
|
-
BuiltinTypes.build_and_register!(
|
13
|
+
type = BuiltinTypes.build_and_register!(
|
14
14
|
:active_record,
|
15
15
|
detached_entity,
|
16
16
|
nil,
|
17
17
|
type_module: Foobara::ActiveRecordType
|
18
18
|
)
|
19
|
+
type.remove_processor_by_symbol(:attributes_declaration)
|
19
20
|
|
20
21
|
BuiltinTypes.install_type_declaration_extensions_for(ExtendActiveRecordTypeDeclaration)
|
21
22
|
|
@@ -16,10 +16,14 @@ module Foobara
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
domain = Foobara::Domain.domain_through_modules(active_record_class)
|
20
|
+
|
21
|
+
name = active_record_class.name.gsub(/^#{domain.scoped_full_name}::/, "")
|
22
|
+
|
19
23
|
{
|
20
24
|
type: :active_record,
|
21
25
|
model_class: active_record_class.name,
|
22
|
-
name
|
26
|
+
name:,
|
23
27
|
model_base_class: active_record_superclass.name,
|
24
28
|
model_module: Util.module_for(active_record_class)&.name,
|
25
29
|
primary_key: active_record_class.primary_key,
|
@@ -18,12 +18,10 @@ module Foobara
|
|
18
18
|
type.element_types = active_record_class.foobara_attributes_type.element_types
|
19
19
|
type_name = type.declaration_data[:name]
|
20
20
|
|
21
|
-
# We don't want to check that the active record is valid as if it were a model
|
22
|
-
type.validators.delete_if do |validator|
|
23
|
-
validator.symbol == :attributes_declaration
|
24
|
-
end
|
25
|
-
|
26
21
|
domain = Domain.domain_through_modules(active_record_class)
|
22
|
+
|
23
|
+
type_name = type_name.gsub(/^#{domain.scoped_full_name}::/, "")
|
24
|
+
|
27
25
|
domain.foobara_register_type(type_name, type)
|
28
26
|
end
|
29
27
|
end
|
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.10
|
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-29 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activerecord
|