tramway-core 1.18.3.4 → 1.18.3.5

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: 3022ae1f46a09e9189dc9a8631dd1df188743e2ad6a9b735bc54666128eab453
4
- data.tar.gz: 13e4ff6a1f40ca6a664f86d83c4b9c73f90dec9016e75350de617582a59ed222
3
+ metadata.gz: 0551fcbf52c09db71a97c6198d33747af8ac7f4bb72e00e6e1b23f41810d9897
4
+ data.tar.gz: 25c38989f7a757b45906057cd0263c8300ba3183d87d47ee4f7d8e5b80fa8184
5
5
  SHA512:
6
- metadata.gz: 1e9c683e1f7d7f335518d8392a6fe08695902efc3b0bb44586a76e44708c234697848712197a2eeeb7bdbd3e4aebb669e735456e40bb9d7579aac55afe3c952d
7
- data.tar.gz: 1029ffafaae5f43dc75ce08b9f982a16914d2b0e3072311513aa3f10ef443612eb33a7a1e6fca0bb14bb31dc5d0f6d81caab9f78144aa18d97b564aaa6bcce57
6
+ metadata.gz: 7b51f713c0f7949d63da70c5b1a3c4db597d4b3e88b190c2907221ca08cbf929598c3bced628ed1385a0b936b75029ad47e2c6f1bbe784a5d2204231d5d46f44
7
+ data.tar.gz: e95f70c2ec16b8f76a81ef6c4e38597ca229e15870fea9fd6b5439c96b3f230ad6ecbada1527a7fa43b38caf2532bcf92f80489397c7871e9b451a018fd201da
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Tramway::Core
1
+ # Tramway::Core ![Ruby](https://github.com/Purple-Magic/tramway-core/workflows/Tests/badge.svg) ![Ruby](https://github.com/Purple-Magic/tramway-core/workflows/Rubocop/badge.svg) [![Gem Version](https://badge.fury.io/rb/tramway-core.svg)](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
- if options&.dig(:polymorphic)
66
- hash.merge! association => @@model_class.send("#{association}_type").values
67
- elsif options
68
- hash.merge!(association => (options[:class_name] || association.to_s.camelize).constantize)
69
- end
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
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Tramway::Core
4
- module Generators
3
+ module Tramway
4
+ module Core
5
+ module Generators
6
+ end
5
7
  end
6
8
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '1.18.3.4'
5
+ VERSION = '1.18.3.5'
6
6
  end
7
7
  end
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
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-10 00:00:00.000000000 Z
12
+ date: 2020-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: audited