svelte-on-rails 23.2.0 → 23.2.2
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: f8fa328e87d9ada849f7cb531e7f2ca5a5caef9a3c4c43b231b366060eb2f452
|
|
4
|
+
data.tar.gz: b316fd8f037a0f700b56f6648b383af606b802e65c21fd23030c0da9916399dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebeb23d19bbd630b0250922cebca37cffb9524eaf1de12a895acb75b6c071ff80fa879fae2999091404ecf0784a892c39b5c200423a01cc68b323675967bc82e
|
|
7
|
+
data.tar.gz: 2808b70bafe5bb0d5f6f34b347ddfe21dcb55611eda252d848b422e5b35ca26da4a6d86bb23c8f578af1aa6ed53ea17d3b50b6497fa8760c617a4493abee4516
|
|
@@ -57,8 +57,12 @@ module SvelteOnRails
|
|
|
57
57
|
_attrs, _assoc = SvelteOnRails::Lib::ToSvelteSupport.separate_associations(attrs)
|
|
58
58
|
|
|
59
59
|
cl = model.reflect_on_association(k)
|
|
60
|
-
raise "
|
|
61
|
-
|
|
60
|
+
raise "[SOR] Association or method «#{k}» not found in model «#{model}»" unless cl || model.method_defined?(k)
|
|
61
|
+
|
|
62
|
+
if !cl # we have a method
|
|
63
|
+
@labels["_#{k}_schema"] ||= {}
|
|
64
|
+
@labels["_#{k}_schema"]['method'] = 'true'
|
|
65
|
+
elsif klass_missing?(cl) && cl.polymorphic?
|
|
62
66
|
@labels["_#{cl.name}_schema"] ||= {}
|
|
63
67
|
@labels["_#{cl.name}_schema"]['polymorphic'] = 'true'
|
|
64
68
|
else
|
|
@@ -74,7 +74,7 @@ module SvelteOnRails
|
|
|
74
74
|
next if %w[offset limit].include?(key_s)
|
|
75
75
|
|
|
76
76
|
reflection = record.class.reflect_on_association(key_s)
|
|
77
|
-
raise ArgumentError, "No association #{key_s.inspect} on #{record.class}" unless reflection
|
|
77
|
+
raise ArgumentError, "No association or method #{key_s.inspect} on #{record.class}" unless reflection || record.class.method_defined?(key_s)
|
|
78
78
|
|
|
79
79
|
related = record.send(key_s)
|
|
80
80
|
|
|
@@ -140,8 +140,6 @@ module SvelteOnRails
|
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
142
|
|
|
143
|
-
svelte_props[:test] = 'hello'
|
|
144
|
-
|
|
145
143
|
ht_opts[:class] = "svelte-component #{ht_opts[:class]}"
|
|
146
144
|
ht_opts[:data][:props] = svelte_props.to_json
|
|
147
145
|
ht_opts[:data][:svelte_status] = (@options[:hydrate] == false ? 'do-not-hydrate-me' : 'ssr')
|