activerecord-uuid-order 0.7.0 → 0.8.0

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: 166a0e6b8e7e1f006e5dbf5a5fbcd21cf5c7bf9cdf44f36fe15e2ca709be5c09
4
- data.tar.gz: 32481ea773a003c513abdfe25a8bf9a8e58c3c2f3b6d7e96081ce0c03089d5b1
3
+ metadata.gz: f69f18b76215c37c938b65b524e091072b664f4d4427a2ed6f6e1e4e39635052
4
+ data.tar.gz: f59b2a982de527bffe8af7bb2e8e13724f54176ed9208b9366d47c239d57bc38
5
5
  SHA512:
6
- metadata.gz: 9120339871ac9258d8757dd89869b9c93d254e44a8d535070ef206a5bd4f9a079765fcc0e74b15a5a8c4bceaef57b18643c638d581b5c5093e46e9aa74f4e4d4
7
- data.tar.gz: 7ce198f89717f47943a31ad888d21dcb58fec6f2ef8f1034c578df89d76420afc77ec0399d615fc8fd02ddf37e71c39a0dd2c4d45e585be32a9c19a07f0057ef
6
+ metadata.gz: c8ad9befc2b277cb90108281b69efdac935b96d877ca69371314539494166ca3331d2c1a62d62357f4fbc5fc9645341ded95e623015b0e7ec15aee7dcc37a4fa
7
+ data.tar.gz: 4039591446814a215f072659dd741a7887eb16a414934a4511e76bbcd491b4e93227630d771834c7c33647ecd60b07a24d60186cfd674c84399885720e668a64
@@ -2,7 +2,11 @@ module ActiveRecord
2
2
  module FinderMethods
3
3
  def ordered_relation
4
4
  if order_values.empty? && (implicit_order_column || primary_key)
5
- order(arel_attribute(implicit_order_column || primary_key).asc)
5
+ if implicit_order_column.present? && implicit_order_column != primary_key
6
+ order(arel_attribute(implicit_order_column).asc, arel_attribute(primary_key).asc)
7
+ else
8
+ order(arel_attribute(implicit_order_column || primary_key).asc)
9
+ end
6
10
  else
7
11
  self
8
12
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordUUIDOrder
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-uuid-order
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2019-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord