hellobase-formtastic 0.3.0 → 0.4.0

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: 23204b79fccf4dbacbe9826a220766e0604923a959673771c8fc38bc6240997e
4
- data.tar.gz: f13d31c76387f8646d180dcf65482b85c38cf742de6297b4dcb07a1b0b4fe5a3
3
+ metadata.gz: 91ed20f61e12cb7e7f2ae092cd5bb50bc1046e67e1ea1951e9f5c34cae10f438
4
+ data.tar.gz: 8622f461fbe818499fe85bde5fb22561f8a9ecddd3c86d3e15b5ca32946cb247
5
5
  SHA512:
6
- metadata.gz: d9561afc8619c56078637790305dc024d0a19e39e58a4b25942ae76ef3a09cd434c1bbe8d3389068dc276709254d1a79fa820973ab911cdc65bfb0318a31a5b8
7
- data.tar.gz: 2e5725f7722d104c5ddecdb173614b7457338eb2030802521045842dcea08adcbaac3c27062bf4dcb2fc49b55040d231624712a9fa0e9d5206aad33393738498
6
+ metadata.gz: a47ca291dfc839b4884d42180c840b5adb03931a7213e16198280ae518710f5ef6d243d83f4d8fb2f5b913bd943975528385cd5b518fb7c2f9d2b6375e76e994
7
+ data.tar.gz: 1ed1b99f2dc90f92361732e65c9f38d2b7043ff2ddb7990ff4bba6751272213db762c58f62a5eb1309afe70bad02187fc9ef57704314a9f240080f04bf1dd537
@@ -42,17 +42,19 @@ module Hellobase
42
42
  end
43
43
 
44
44
  define_method method do
45
- send :"#{base}=",
46
- ivars.any? {|v| instance_variable_get(v).blank? } ?
47
- nil :
48
- [
49
- instance_variable_get(ivars[0]),
50
- [
51
- instance_variable_get(ivars[1]),
52
- instance_variable_get(ivars[2])
53
- ].join(':'),
54
- instance_variable_get(ivars[3]),
55
- ].join(' ')
45
+ val = if ivars.any? {|v| !instance_variable_defined?(v) || instance_variable_get(v).blank? }
46
+ nil
47
+ else
48
+ begin
49
+ Time.use_zone(instance_variable_get(ivars[3])) do
50
+ Time.parse("#{instance_variable_get(ivars[0])} #{instance_variable_get(ivars[1])}:#{instance_variable_get(ivars[2])}")
51
+ end
52
+ rescue ArgumentError
53
+ nil
54
+ end
55
+ end
56
+
57
+ send :"#{base}=", val
56
58
  end
57
59
 
58
60
  private method
@@ -1,5 +1,5 @@
1
1
  module Hellobase
2
2
  module Formtastic
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellobase-formtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-19 00:00:00.000000000 Z
11
+ date: 2025-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin