positioning 0.2.3 → 0.2.4

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: a486284bed84d9458dfc46093bf97d94f56e808de40843bffbc5cdacde4606b3
4
- data.tar.gz: f31839ad358b3db74b55596dda9c77ce32a8a661923dc257962ac36deb7520c7
3
+ metadata.gz: 02113cf1d0279ee7f3b304429eb5af8a4e6e46254f2397cae704191900cfd0a5
4
+ data.tar.gz: b248f330a5b3373b396f487bb11008a14cdf1c6f292b6c63a7000dd1150cfa8a
5
5
  SHA512:
6
- metadata.gz: 54a7ea806656b3cab3b32846dfb365b9107389d83ac37fed41b145a3daa82917ce27c2f7765713e6440d6571d4b735d9a958713e65c61879244378b9c6f1511e
7
- data.tar.gz: 85af57db02799e96fddb74f9a14debaa1a0e0d2ff06144f41c50be9d5bd9c66d103fbd1cefc86a9c0e9061e3f172c37015eee078440b418da055bd4c67075c97
6
+ metadata.gz: 94333e70ecd013a4970c4667fb715e91fca7450bcb6c52dd57706d8134c8a02ab8fc698a4a2abcb34bbe69dac640f528cce45df351a2bb2d42958e2a77468f23
7
+ data.tar.gz: f273602f9fff96622aa9d9d7706570629de601468b782e186df71936084053a2368595cf116827d4c1f86775cfa4ca150eef0e662895bf79c3afd6560d3002b0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.4] - 2024-07-31
4
+
5
+ - Avoid unnecessary SQL queries when the position hasn't changed.
6
+
3
7
  ## [0.2.3] - 2024-07-06
4
8
 
5
9
  - Advisory Lock can now be optionally turned off via `advisory_lock: false` on your `positioned` call. See the README for more details. Advisory Lock remains on by default. Thanks @joaomarcos96!
@@ -20,21 +20,20 @@ module Positioning
20
20
  end
21
21
 
22
22
  def update_position
23
+ return unless positioning_scope_changed? || position_changed?
24
+
23
25
  clear_position if positioning_scope_changed? && !position_changed?
24
26
 
25
27
  solidify_position
26
-
27
- if positioning_scope_changed? || position_changed?
28
- move_out_of_the_way
29
-
30
- if positioning_scope_changed?
31
- contract(positioning_scope_was, position_was..)
32
- expand(positioning_scope, position..)
33
- elsif position_was > position
34
- expand(positioning_scope, position..position_was)
35
- else
36
- contract(positioning_scope, position_was..position)
37
- end
28
+ move_out_of_the_way
29
+
30
+ if positioning_scope_changed?
31
+ contract(positioning_scope_was, position_was..)
32
+ expand(positioning_scope, position..)
33
+ elsif position_was > position
34
+ expand(positioning_scope, position..position_was)
35
+ else
36
+ contract(positioning_scope, position_was..position)
38
37
  end
39
38
  end
40
39
 
@@ -1,3 +1,3 @@
1
1
  module Positioning
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
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.2.3
4
+ version: 0.2.4
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-07-05 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport