active_record_distinct_on 1.0.0 → 1.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '096152ff6a14c3419f6d8196a9b8fcfd6fb493ad77db7171f3294b475d461415'
|
4
|
+
data.tar.gz: 375f1085f3eb6d7e1077fc2a0745a5d225b181118662a88f54640fd34d55c054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfda3ac9d31b0062ae5fba155eedd12a55e0e0be0b440029d4c387c6d579fb10a2c10c0f35eef235bce842eef65bfe423a7e471a9194bb1d14f49e0d8aa8c541
|
7
|
+
data.tar.gz: f68fdb758e4d9e17b72e1ba3797075d3b13f81af7c5af3c253cf127756bee8fe9093c491e9ce9a923339202f5647b4a33ab2d13f1fc6dcea4ef1f4e98293240d
|
@@ -28,7 +28,13 @@ module ActiveRecordDistinctOn
|
|
28
28
|
|
29
29
|
def distinct_on!(*fields)
|
30
30
|
fields.flatten!
|
31
|
-
fields.map! { |field|
|
31
|
+
fields.map! { |field|
|
32
|
+
if klass.attribute_alias?(field)
|
33
|
+
arel_attribute(klass.attribute_alias(field).to_sym)
|
34
|
+
else
|
35
|
+
arel_attribute(field)
|
36
|
+
end
|
37
|
+
}
|
32
38
|
self.distinct_on_values += fields
|
33
39
|
self
|
34
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_distinct_on
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alec Larsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -76,16 +76,16 @@ dependencies:
|
|
76
76
|
name: simplecov
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - '='
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 0.18.1
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - '='
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 0.18.1
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: pry
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|