phlexi-form 0.7.0 → 0.7.2

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: 126651d9514affaa03136f609004f61c849e71bd513dfddda178c1da0e13dbfe
4
- data.tar.gz: 75ecd62c9a7f626844787d6c38be13df30238f53944127d32a6cda5446c8c9b1
3
+ metadata.gz: 5efa476cb7e4856462046b6658c996843537b102f807e5c7c08a2d8e88520d11
4
+ data.tar.gz: 1938daa8358013cee51abd0b4d50188c99459c6b714470002e4ec26a77e0b224
5
5
  SHA512:
6
- metadata.gz: 5d6409ed4259b7cdc42063100a57d3990533e4f2b8325ecdd20c64859868f248a424353af260a489023c99900ee820331b345a84a7c4703b4ecde8f916d20e65
7
- data.tar.gz: b9d48ed9c76a82b5bd39d1153c2ad51905ecf31f7f627b97bb219526eac69029048f5eca1eaf0e4613f27c3931d486059c83726790568bc143ceaf13c1846810
6
+ metadata.gz: a0b9918b54df47959563f801982e0cbfae8b2a22f21ea2900cb64be952c891b7df7702361255c09063b45a858ed4fc9445911bc73d1766edf3f91ed91000417a
7
+ data.tar.gz: 73de9965cf5106cefe30081ba2d2a822d725ec203cb26d4d1fd2f2be53b336fd56aa227c2935b85b6d405ddf9a4dca35096f010d98d4724285d9dbfd9c2d8df8
@@ -20,10 +20,17 @@ module Phlexi
20
20
 
21
21
  def selected?(option)
22
22
  if attributes[:multiple]
23
- @options_list ||= Array(field.value)
24
- @options_list.any? { |item| item.to_s == option.to_s }
23
+ field_value.any? { |item| item.to_s == option.to_s }
25
24
  else
26
- field.value.to_s == option.to_s
25
+ field_value.to_s == option.to_s
26
+ end
27
+ end
28
+
29
+ def field_value
30
+ if attributes[:multiple]
31
+ Array(field.value)
32
+ else
33
+ field.value
27
34
  end
28
35
  end
29
36
 
@@ -16,6 +16,8 @@ module Phlexi
16
16
  def build_input_attributes
17
17
  attributes[:type] = :file
18
18
  super
19
+
20
+ @include_hidden = attributes.delete(:include_hidden)
19
21
  # ensure we are always setting it to false
20
22
  attributes[:value] = false
21
23
  end
@@ -17,6 +17,7 @@ module Phlexi
17
17
  attributes.fetch(:input_param) {
18
18
  attributes[:input_param] = :"#{association_reflection.name.to_s.singularize}_ids"
19
19
  }
20
+ attributes[:multiple] = true
20
21
  end
21
22
  end
22
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Form
5
- VERSION = "0.7.0"
5
+ VERSION = "0.7.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexi-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-21 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex