pxs-forms 0.0.21 → 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: ed122aca21c3e0ffba66cb2c40b2d367b282d2bdd81dc808a02c4180de755be0
4
- data.tar.gz: cd9dd4c71b2fa36a0479c04a5a88875d96e2e2ce390642c8899dc00e099a3fbf
3
+ metadata.gz: 981f2859bcb9b331063ac4dae5aaba3c95265e783b07b8d37b39599aaba639ed
4
+ data.tar.gz: 81befc04467b8c087dc4aad8617d6008686fb812be54c4cbc1ebce7e582ce3bf
5
5
  SHA512:
6
- metadata.gz: efbcf39cf0fba58b2273b906d2933bab6352def09ea1d0284efd08f9408eddcc571c4e2c53aecf70c5f2453170c165c363c20ab839341190361fdcd594ab0410
7
- data.tar.gz: 07ea4ad16f6ff6076e99f7ac3a804a554f59c202d7a090252bf3c6c07eccaea2aca3cd2c1c51dbdcec03f921f1beb4cfe15c446663ae128ab6b11b9c0d0bdac6
6
+ metadata.gz: dcfe9e12c264106324a7f83c149783a734d2236165461e808e0885f83cb2c7de63c010240e50b064e7248adf2da1a2e12fcdc2972d67d366d7d7c23ad1a0e4c8
7
+ data.tar.gz: 30aec3cb45e6393b39f96a3fe9f3bb5ea342ceb784d4a76b94ce837edbd908b3a6a6972cdc8613f8ecddb13f19205960cfa01ebf4e2a876db571d97cfa17282f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # pxs-forms
2
+
3
+ ## Unofficial Release
4
+
5
+ ## [0.1.2] - 2025-03-09
6
+
7
+ - Fix Multiple Selects not selecting the correct values
8
+
9
+ ## [0.1.1] - 2025-03-08
10
+
11
+ - Fix a bug where empty values are ignored when explicitly specified
12
+
13
+ ## [0.1.0]
14
+
15
+ - Mostly bug-free release, testing needs to be done
16
+
1
17
  ## [Unreleased]
2
18
 
3
19
  ## [0.0.1] - 2024-03-20
@@ -16,4 +32,4 @@
16
32
  - Use base input names and IDs in model form builder
17
33
  - Add select or create subform as a model form builder method
18
34
  - Add nested association form and related methods to models helper
19
- - Add shorthand methods: model_form_for, model_form_with
35
+ - Add shorthand methods: model_form_for, model_form_wit
@@ -241,10 +241,11 @@ class ModelFormBuilder < ActionView::Helpers::FormBuilder
241
241
  input_options = options || {}
242
242
 
243
243
  multiple = input_options[:multiple]
244
+ selected = if object.respond_to? attribute then object.send(attribute) else object[attribute] end
244
245
 
245
246
  safe_join [
246
247
  collection_input(attribute, options) do
247
- @template.collection_select(object.class.model_name.singular.to_sym, attribute, options[:collection], value_method, text_method, {selected: object[attribute]}.merge(options[:select] || {}), merge_input_options({class: "#{"custom-select" unless multiple} #{"is-invalid" if has_error?(attribute)}"}, options[:input_html]))
248
+ @template.collection_select(object.class.model_name.singular.to_sym, attribute, options[:collection], value_method, text_method, {selected:}.merge(options[:select] || {}), merge_input_options({class: "#{"custom-select" unless multiple} #{"is-invalid" if has_error?(attribute)}"}, options[:input_html]))
248
249
  end
249
250
  ]
250
251
  end
@@ -358,9 +359,6 @@ class ModelFormBuilder < ActionView::Helpers::FormBuilder
358
359
  else
359
360
  options.merge(user_options)
360
361
  end
361
-
362
- # filter out hash keys with an empty/nil value
363
- options.filter do |key,value| value.present? end
364
362
  end
365
363
 
366
364
  def base_input_name
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pxs
4
4
  module Forms
5
- VERSION = "0.0.21"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxs-forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Poubelle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-06 00:00:00.000000000 Z
11
+ date: 2025-03-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: