tramway-core 1.18.3.4 → 1.18.3.5
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
- data/README.md +1 -1
- data/app/forms/tramway/core/application_form.rb +9 -5
- data/lib/tramway/core/generators.rb +4 -2
- data/lib/tramway/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0551fcbf52c09db71a97c6198d33747af8ac7f4bb72e00e6e1b23f41810d9897
|
|
4
|
+
data.tar.gz: 25c38989f7a757b45906057cd0263c8300ba3183d87d47ee4f7d8e5b80fa8184
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b51f713c0f7949d63da70c5b1a3c4db597d4b3e88b190c2907221ca08cbf929598c3bced628ed1385a0b936b75029ad47e2c6f1bbe784a5d2204231d5d46f44
|
|
7
|
+
data.tar.gz: e95f70c2ec16b8f76a81ef6c4e38597ca229e15870fea9fd6b5439c96b3f230ad6ecbada1527a7fa43b38caf2532bcf92f80489397c7871e9b451a018fd201da
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Tramway::Core
|
|
1
|
+
# Tramway::Core   [](https://badge.fury.io/rb/tramway-core)
|
|
2
2
|
|
|
3
3
|
*If you need translation of this Readme, please message us kalashnikov@ulmic.ru. We'll translate for you and post to this page*
|
|
4
4
|
|
|
@@ -61,12 +61,16 @@ class Tramway::Core::ApplicationForm
|
|
|
61
61
|
options = @@model_class.reflect_on_all_associations(:belongs_to).select do |a|
|
|
62
62
|
a.name == association.to_sym
|
|
63
63
|
end.first&.options
|
|
64
|
+
add_polymorphic_association hash, association, options
|
|
65
|
+
end
|
|
66
|
+
end
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
def add_polymorphic_association(hash, association, options)
|
|
69
|
+
if options&.dig(:polymorphic)
|
|
70
|
+
hash.merge association => @@model_class.send("#{association}_type").values
|
|
71
|
+
elsif options
|
|
72
|
+
hash.merge(association => (options[:class_name] || association.to_s.camelize).constantize)
|
|
73
|
+
else
|
|
70
74
|
hash
|
|
71
75
|
end
|
|
72
76
|
end
|
data/lib/tramway/core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tramway-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.18.3.
|
|
4
|
+
version: 1.18.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pavel Kalashnikov
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-08-
|
|
12
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: audited
|