positioning 0.1.5 → 0.1.6

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: 1a18c3175781c6d4509ea42db1583e68bb2e7258e9c0b99201b1b551fc50ccd7
4
- data.tar.gz: 8ceb46c8c93882d2e82e88f4d9c5bcafb3371830dd6d5169cf23dd76d8ba6cd0
3
+ metadata.gz: 2fa6907a0507b7978c58578596c4e6ca16b7e334eb98b3fa42cba47a0d0b89b5
4
+ data.tar.gz: ed8f3126f69cb0f8780244a05d48e46abd0b64468ad47838f0d5827b4fa943ff
5
5
  SHA512:
6
- metadata.gz: 19ced8dddfaefd60c644f19ac576513185e5f3dfa52e8aaabab59f390042f1937bfd3f24874bd228012b337f9f843963b6261b25133d5d1d54f2d606d5c08b7a
7
- data.tar.gz: ac66e6a3eeb7ab20d54511640c9c1e1e20090b9cd0d01cf583031944d42e7f517dc603afc9b59b49c35617a437f5ebbdbf406e0b1cc71beff3413fd8cf73d76b
6
+ metadata.gz: 5d35b26bf717252dc30d828b2fff2b5b36c82ccd5b33d5480798cc57e38bacf9434120d2a478d448998c368286272a9dc2604cb8d3ebd071da0a55c8fa4ad5ba
7
+ data.tar.gz: 3b9c21bb1a3fe42c0799ffe6e991b29f7c17fd4efec8ff3b159afa41cd8a6b8b1e975e47c8e69e22dfd673352b105f2c55d85887a07d90e528b2cd0c54b3a318
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.6] - 2024-03-05
4
+
5
+ - Allow the position to be passed as a JSON object so that we can pass in complex positions from the browser more easily.
6
+
3
7
  ## [0.1.5] - 2024-03-04
4
8
 
5
9
  - Allow empty strings to represent nil for the purposes of solidifying a position
@@ -96,9 +96,20 @@ module Positioning
96
96
  end
97
97
 
98
98
  def solidify_position
99
- position_before_type_cast = @positioned.read_attribute_before_type_cast @column
100
- position_before_type_cast.to_sym if position_before_type_cast.is_a? String
101
- position_before_type_cast = position_before_type_cast.symbolize_keys if position_before_type_cast.is_a? Hash
99
+ position_before_type_cast = @positioned.read_attribute_before_type_cast(@column)
100
+
101
+ if position_before_type_cast.is_a? String
102
+ begin
103
+ position_before_type_cast = JSON.parse(position_before_type_cast, symbolize_names: true)
104
+ rescue JSON::ParserError
105
+ end
106
+
107
+ if position_before_type_cast.is_a?(String) && position_before_type_cast.present?
108
+ position_before_type_cast = position_before_type_cast.to_sym
109
+ end
110
+ elsif position_before_type_cast.is_a? Hash
111
+ position_before_type_cast = position_before_type_cast.symbolize_keys
112
+ end
102
113
 
103
114
  case position_before_type_cast
104
115
  when Integer
@@ -1,3 +1,3 @@
1
1
  module Positioning
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: positioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendon Muir
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-04 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport