positioning 0.1.0 → 0.1.1

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: d2088ce4125fed14b6422ec4e02e1ca5a203d724f0cfaafc043ff7b7c0465a03
4
- data.tar.gz: 9aa3da89865ab6e2336bcb00a7259b97bd69bc3c639b0495c551a1feb33c24fe
3
+ metadata.gz: e0d883985a674ffd2262b5ae6fbfa004cdeb21f76cb4f47b293c252498abf047
4
+ data.tar.gz: 6b2e92166a991cc255e9db3eacd1f3a504e165033d5351285c6200e6a4e44f78
5
5
  SHA512:
6
- metadata.gz: 737adf268dda74000333e2f3d316c58d162d13385a219e3b48668fffb04a7a0b55f197dba5d19b58b2f32b8f1496c10c8dc432b293fffde1142053719facfdc2
7
- data.tar.gz: 8165738f13801f4d8bb8f749c19afe0939a9d6b2e5907038c9b10d7777f7af6daf6f463eac1fc981288c3fba21c69ce19bfa722988d814cdac68509926a40233
6
+ metadata.gz: 3a21c3d4429ba5bb280490e555781023a4062df76760d37ae77c073cacb8e875c3a57e9735f15e042d9ed63445865ce1bddf4e52ef3a6db79896945fd8b417e2
7
+ data.tar.gz: 658091668c0a500dddd65275bfabc4506358fce770cc6b9a01026f7803d26a10386e37fec883a13a96e3f42be8d879d936efafec5127880b9e55fa5ca62ee0d2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2024-02-07
4
+
5
+ - Fix issues with STI based models
6
+
3
7
  ## [0.1.0] - 2024-02-07
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- positioning (0.1.0)
4
+ positioning (0.1.1)
5
5
  activerecord (>= 6.1)
6
6
  activesupport (>= 6.1)
7
7
 
@@ -147,15 +147,11 @@ module Positioning
147
147
  end
148
148
 
149
149
  def positioning_columns
150
- @positioned.class.positioning_columns[@column]
150
+ base_class.positioning_columns[@column]
151
151
  end
152
152
 
153
153
  def positioning_scope
154
- @positioned.class.where(
155
- positioning_columns.to_h { |scope_component|
156
- [scope_component, @positioned.send(scope_component)]
157
- }
158
- ).order(@column)
154
+ base_class.where(@positioned.slice(*positioning_columns)).order(@column)
159
155
  end
160
156
 
161
157
  def in_positioning_scope?
@@ -1,3 +1,3 @@
1
1
  module Positioning
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/positioning.rb CHANGED
@@ -15,6 +15,10 @@ module Positioning
15
15
  end
16
16
 
17
17
  def positioned(on: [], column: :position)
18
+ unless base_class?
19
+ raise Error.new "can't be called on an abstract class or STI subclass."
20
+ end
21
+
18
22
  column = column.to_sym
19
23
 
20
24
  if positioning_columns.key? column
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.0
4
+ version: 0.1.1
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-02-24 00:00:00.000000000 Z
11
+ date: 2024-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport