tramway-core 4.0 → 4.0.1.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: 446432a08c42283f3320bceb38677d94825d6183b78f79faeeaf0560375065e2
4
- data.tar.gz: 13ede23552b1d495a040c43c04a9c906260f395a71743805d88f1035fa29a716
3
+ metadata.gz: 1e06c110cd0f30a7243f4e279aa171da53cc31f6491b42499c46773e8246f530
4
+ data.tar.gz: 478b5ace1fb571aea1c844affeee3d33f0871d31958f0c02b0740d7c3d01b313
5
5
  SHA512:
6
- metadata.gz: 394b4a884c0cf601cc9a204a97763b0d9e9747eca6d68f5d7860457a96d75d53f32b5399ceccdaae47679e426cd9318d6a9dcd09f1f26a83e1f711900fe71f10
7
- data.tar.gz: 524ffa77175f6ffbda64c7d6812ba5ccaa34c160b9c21a02fdc26600d3434fa0c3d400de917aed327b9e841311387fa317a6e641f37abe3df2aff7729e700d53
6
+ metadata.gz: dac7d047d46554fc5223d73773fc9b89320fbad418f9198f7bdda46fcac62fa0f01c5aee54b348ab729855f602a698df07e152a7d23113da1dbc8fd778af824c
7
+ data.tar.gz: 8ab86f5111052e9fc2db73ba09a0fdf910fcef1ee1b6610a026edf3502cf44c4d394b790982a16434c9020dd57d108d9ad61cbe130855279ddf51420c2618cea
@@ -6,13 +6,18 @@
6
6
  - type = type[:type]
7
7
  - if type.class.in?([ Symbol, String ]) || type&.dig(:input_options)
8
8
  - type = type.to_sym
9
- - unless type == :hidden
9
+ - if !type.in?([ :hidden ]) && input_params.dig(:options, :label) != false
10
10
  = form.label form_object.model.class.human_attribute_name property
11
11
  - case type
12
12
  - when :default
13
13
  = form.input property, **default_params(**input_params)
14
14
  - when :association
15
15
  = form.association property, **association_params(**input_params)
16
+ - when :hidden_association
17
+ - if form_object.public_send(property)&.id
18
+ = form.association property, **association_params(**input_params).merge(as: :hidden, input_html: { value: form_object.public_send(property)&.id })
19
+ - else
20
+ = form.association property, **association_params(**input_params).merge(as: :hidden)
16
21
  - when :polymorphic_association
17
22
  = form.input property, **polymorphic_association_params(**input_params.merge(value: value))
18
23
  - else
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '4.0'
5
+ VERSION = '4.0.1.2'
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: '4.0'
4
+ version: 4.0.1.2
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: 2022-02-07 00:00:00.000000000 Z
12
+ date: 2022-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: audited