active_element 0.0.30 → 0.0.31

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: 1469f981b1ca1a72146c9e6a241d79ba89151468deb8cc23a6f684eeb491b0a1
4
- data.tar.gz: acdbd91537ee25169fb7639f083661b70fa04d536ebf96cf24c4bb50bbcac087
3
+ metadata.gz: 4674930632a2913f699ce77bb0ee31d83b8e11a0356a013beaa6b7d740337a0a
4
+ data.tar.gz: 3d8ed9fde6a7a6072075afb7db1c12892ca5113b5beaf14221888fd7a7f96da8
5
5
  SHA512:
6
- metadata.gz: 9e6d03d68afd27853fa96de0ae0fabd0cbb3dbad46d329eacdfc45c523c770fe9d85649191f5d2215f6b4a494fa14169b2986ac39ca8f25f07547ed5a62599e5
7
- data.tar.gz: 79751155402da2ab9f72710db51517d214cf55b15e4240c444d3489d33f703e944123e1fa9146d5c2a8c47c8426bb42269801dba30c230c7f1f231ed248cba9a
6
+ metadata.gz: 137906e98706fe08498ebebc90fb37d2ca85ba5dc2e4ca55411cc750c515312b55473f17b0815a554744d8db6fa0f5239c3c06dbef2d22098c07258242e4a37f
7
+ data.tar.gz: 45f050797338f9c7d6ebd47f203a2fb3db6974a92a160df50606c91a43d20cab7956dbfe3673d53c5283347825cafa273f92ee4a00654f6c30cfad058960b23b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_element (0.0.30)
4
+ active_element (0.0.31)
5
5
  bootstrap (~> 5.3.0alpha3)
6
6
  kaminari (~> 1.2)
7
7
  paintbrush (~> 0.1.2)
@@ -46,11 +46,20 @@ module ActiveElement
46
46
 
47
47
  def scalar?(field)
48
48
  return true if relation?(field)
49
- return true if %i[json jsonb].exclude?(column(field)&.type)
49
+ return true if %i[json jsonb].exclude?(field_type(field))
50
50
 
51
51
  false
52
52
  end
53
53
 
54
+ def field_type(field)
55
+ options_proc = controller.active_element.state.field_options[field]
56
+ return column(field)&.type if options_proc.nil?
57
+
58
+ field_options = FieldOptions.from_state(field, controller.active_element.state, nil, controller)
59
+ options_proc.call(field_options)
60
+ field_options.type || column(field)&.type
61
+ end
62
+
54
63
  def json_params(fields)
55
64
  # XXX: We assume all non-scalar fields are JSON fields, i.e. they must have a definition
56
65
  # defined as `config/forms/<model>/<field>.yml`. If that file does not exist, allow
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveElement
4
- VERSION = '0.0.30'
4
+ VERSION = '0.0.31'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_element
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-18 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap